Search code examples
jar

.jar file quickly opens, then closes


I am trying to make a FTB server that me and my friends can play on. So, I downloaded the .jar and it said "Choose what to open with. SO, I assigned java binary to what it is opened with. It then now opens, but then not less then a second later, closes. I tested with other .jar files. Each one of them either didn't open at all, or opened quickly, then closes. WHat could be wrong?


Solution

  • More than likely the jar (which is just a zip of the programs main classes) is running into an error and exiting.

    In order to find and resolve that error you need to see the error message!

    first locate the jar file in either your terminal or command prompt and run the following command

    java -jar <YOUR_JAR_FILE_NAME>.jar

    You will see any output sent from the java program to the console so you can diagnose and resolve it!