Skip to content

Commit

Permalink
Merge pull request cheat#47 from grumpyf0x48/master
Browse files Browse the repository at this point in the history
Initial import of javac cheatsheet
  • Loading branch information
chrisallenlane authored Nov 10, 2020
2 parents 85b58c7 + 037469c commit 20d55f2
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions javac
Original file line number Diff line number Diff line change
@@ -0,0 +1,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

0 comments on commit 20d55f2

Please sign in to comment.