Quickly run .jar files in Windows and Linux
Prerequisites: N/A
Difficulty Level: Member • Nerd • Platypus
Estimated Time: 3 minutes
Expected Outcome: The .jar file will execute
Tools Required: A Windows or Linux computer with Java installed and a .jar executable file
Steps to Perform
- Open a command prompt for Windows or a terminal session for Linux
- For Windows users press Windows key+R type "cmd" and press enter
- For Linux users press Ctrl+Alt+T
- Navigate to the directory the contains the .jar file
- An easy way to do this is to drag and drop the .jar file into the command prompt window
- You can also use the cd command and manually type out the directory that contains your .jar file. For example:
cd C:\Users\user\Desktop
- Once you are in the same directory as the .jar file run the following command
java -jar "YOUR FILE NAME.jar"
This should execute your .jar file