Article Directory
All operations completed in the window.
the javac [target path] [source]
I.e., the target path storage position to compile the results, the following detailed explanation. Compared with the original source files needed to compile, including the * .java and jar package.
After the target path for the compiled * .class file location.
Target path may be omitted. If omitted then placed in the current position. (Provided that run cmd in the current directory).
javac Test.java
Specify the required path parameters -d, several forms as follows:
javac -d E:\javactest\ Test.java
The resulting file in E: \ javactest \ under.
(A) generate files in the current directory, if Test.java if there is a package name, then in subfolders.
javac -d . Test.java
(Ii) generate files in the current directory classes, if Test.java if there is the package name, the next sub-file.
javac -d ./classes Test.java
(C) generate files in the current directory classes, if Test.java if there is the package name, the next sub-file.
javac -d classes Test.java
Source files include your files and * .java jar package. Individual files directly put the file name.
Added directly without third-party libraries, files between different sources separated by a space, the path to the file containing spaces require double quotes.
javac -d ./classes Test.java Test01.java
In addition to adding Test.java Test01.java two files, but also need to present all * .java to compile the src directory.
javac -d classes Test.java Test01.java src/*.java
When the presence of all the large number of files can be placed in the file location of a document and use the file @ added. File format as shown in FIG.
The following command will Test.java filelist.txt shown and all files are packaged.
javac -d classes Test.java @filelist.txt
-classpath -cp by adding the latter.
javac -d classes -classpath XXXX.jar @filelist.text
Add multiple files with a semicolon
javac -d classes ;XXXX.jar;d:\XXX\*.jar @filelist.text
Can be generated by jar command packet, i.e. classes \ class \ ii under com \ LL01 packaged into test.jar
jar cf test.jar classes\com\ii\LL01