All posts by wwboy6

Game Design - Programming - Playing


Note for compile Java on console

Common compilation command:
java -classpath bin:/path/a:/path/b/classes.jar -d bin -sourcepath src
/src/com/PackageNameA/*.java /src/com/PackageNameB/*.java
-classpath <paths>  -  a list of folders/JARs separated by “:”. All class file will be included for compilation. Usually, class path should include the destination of class file of the project to include other modules
-b <path>  -  the destination of class file to be produced
-sourcepath <path>  -  the source file folder. The java files there may be compiled by auto compilation
ended with a list of source files to be compiled, separated by space

Usually, class path should include Java Runtime library
Linux: ${JRE_PATH}/lib/rt.jar
MacOS: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/classes.jar
Different version of Java may has different path of the library