Friday 15 July 2011

command line - Compile and run java classes in different packages with multiple jar libraries -



command line - Compile and run java classes in different packages with multiple jar libraries -

i have project including 2 packages , several classes in each.

there 2 jar libraries (json-simple-1.1.1.jar , guava-10.0.1.jar) included through "project properties --> build path" window.

i can run project in eclipse, want compile , run them on server (using command line).

so moved whole project folder (let me proj1) server.

i want compile these classes on server. then, run 1 of classes (let me class1.java).

i have tried next command compile java files in folders:

javac -classpath ./guava-10.0.1.jar;./json_simple-1.1.1.jar -sourcepath src -d src ./src/**/*.java

but got error:

javac: no source files usage: javac <options> <source files> utilize -help list of possible options -bash: ./json_simple-1.1.1.jar: no such file or directory

when remove sec jar file command, lot of errors lines of classes working json (meaning knows source files!).

please guide me how compile them in command line , run class1.java.

java command-line compilation

No comments:

Post a Comment