Skip to content

Commit

Permalink
Initial import of javac cheatsheet
Browse files Browse the repository at this point in the history
  • Loading branch information
grumpyf0x48 committed Oct 7, 2020
1 parent 0c8e75a commit 4545d02
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 @@
# Compile a simple source file
javac HelloWorld.java

# Compile several source files
javac *.java

# Specify another destination directory
javac -d build HelloWorld.java

# Use another source directory for source dependencies
javac -sourcepath src/dependencies/java Main.java

# Define where compiled dependencies should be searched
javac -classpath lib/commons-cli-1.4.jar:lib/log4j-1.2.12.jar HelloWorld.java

# Consider warnings as errors
javac -Werror NoWarning.java

# Compile Java 7 code
javac -source 1.7 Java7.java

# Make the compiler more verbose
javac -verbose *.java

# Display usage of deprecated APIs
javac -deprecation App.java

# Include debugging info in class files
javac -g HelloWorld.java

# Display version
javac -version

# Getting help
javac -help

0 comments on commit 4545d02

Please sign in to comment.