- Compile Java Source Code
- Use
javac
to compile your.java
files into.class
files.
- Use
- Package into a JAR File
- Use the
jar
command to package your compiled classes and resources into a JAR filejar cf example.jar -C <path-to-compiled-classes> .
- This results in a JAR file named
example
containing the contents of the specified directory
- Use the
- Execute
- Run your application JAR with
java -jar example.jar
- Run your application JAR with