- Compile Java Source Code
- Use
javacto compile your.javafiles into.classfiles.
- Use
- Package into a JAR File
- Use the
jarcommand 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
examplecontaining the contents of the specified directory
- Use the
- Execute
- Run your application JAR with
java -jar example.jar
- Run your application JAR with