forked from cheat/cheatsheets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
javac
35 lines (24 loc) · 815 Bytes
/
javac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# To compile a simple source file:
javac HelloWorld.java
# To compile several source files:
javac *.java
# To specify another destination directory:
javac -d build HelloWorld.java
# To use another source directory for source dependencies:
javac -sourcepath src/dependencies/java Main.java
# To define where compiled dependencies should be searched:
javac -classpath lib/commons-cli-1.4.jar:lib/log4j-1.2.12.jar HelloWorld.java
# To consider warnings as errors:
javac -Werror NoWarning.java
# To compile Java 7 code:
javac -source 1.7 Java7.java
# To make the compiler more verbose:
javac -verbose *.java
# To display usage of deprecated APIs:
javac -deprecation App.java
# To include debugging info in class files:
javac -g HelloWorld.java
# To display version:
javac -version
# To get help:
javac -help