ThePixelPuppy
ThePixelPuppy

Reputation: 25

.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?

Upvotes: 1

Views: 20167

Answers (2)

kxnyshk
kxnyshk

Reputation: 301

In your terminal, where your .jar file is located, type and run the following command :

java --enable-preview -jar <JAR FILE NAME>.jar

Most probably the .jar fill will open, or it will show you the error, which you can then resolve.

Upvotes: 0

Christian Bartram
Christian Bartram

Reputation: 411

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!

Upvotes: 7

Related Questions