All Posts programming Java application compiler | Javac cheat-sheet

Java application compiler | Javac cheat-sheet

· 104 words · 1 minute read

javac is Java application compiler.

Compile a .java file:

javac path/to/file.java

Compile several .java files:

javac path/to/file1.java path/to/file2.java ...

Compile all .java files in current directory:

javac *.java

Compile a .java file and place the resulting class file in a specific directory:

javac -d path/to/directory path/to/file.java

More information: https://docs.oracle.com/en/java/javase/20/docs/specs/man/javac.html .

I hope you enjoyed reading this post as much as I enjoyed writing it. If you know a person who can benefit from this information, send them a link of this post. If you want to get notified about new posts, follow me on YouTube , Twitter (x) , LinkedIn , and GitHub .