1:javac-d the compiled class file output directory Specifies the source file location. For example
For multiple packages under the source code compilation, it seems that Javac does not support iterative compilation, may need to pass through multiple source location to compile. One convenient way is to use the Windows Bat script or the Linux shell script as a compile source file list and then compile according to the source file manifest, for example:
DIR/S/B *.java> sources.txt
The resulting sources.txt format is as follows:
Then use:
javac-d classes @sources. txt
To complete the compilation. The source files in the current example do not involve dependency issues, and there is no need to consider the order of the source files in Sources.txt when there are dependencies. Because the compiler will automatically compile dependent source files at compile time when it finds that the class used does not compile.
Create jar packages can be packaged using the JAR-CVF Jarname.jar class folder
Running a Java package can use Java-classpath Jarname.jar mainclass
Java uses pure command line to package projects