Skip to content

Instantly share code, notes, and snippets.

@airicbear
Last active October 5, 2019 12:59
Show Gist options
  • Save airicbear/3458c91252c9cc8c1fac6c8fe4504d9e to your computer and use it in GitHub Desktop.
Save airicbear/3458c91252c9cc8c1fac6c8fe4504d9e to your computer and use it in GitHub Desktop.
Java Executable Jar

Creating an executable JAR (Java Archive) file

Compile your source code (.java files to .class files)

javac <PATHS_TO_SRC>

Verbosely create your executable JAR file

jar cvfe <EXEC_JAR_NAME>.jar <PATHS_TO_CLASSES>

Run the JAR

java -jar <EXEC_JAR_NAME>.jar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment