Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to open/run .jar file (double-click not working)?

I can't open or run my .jar file.

I just installed java, but I tried to open the .jar with other programs first, so the double-click defaults to something else and I can't change it back.

java -jar myfile.jar`

Above command returns:

'java' is not recognized as an internal or external command, operable program or batch file.

Is there a way I can still open/run this?

e: OS is Windows 8.

Also, I downloaded the .jar file; didn't create it myself (if that's relevant) Not sure if it contains an executable (but I think it does).

like image 209
nivk Avatar asked Nov 13 '13 23:11

nivk


People also ask

How do I fix a jar file that won't open?

I understand your frustration regarding this issue and I'll do my best to help. Once installed, right-click on the . jar file and select "Properties" > under the General tab, check if you'll have the option to Unblock the file, select OK, then try again.


2 Answers

you can use the command prompt:

javaw.exe -jar yourfile.jar

Hope it works for you.

like image 153
Riggs Avatar answered Sep 30 '22 01:09

Riggs


There are two different types of Java to download: The JDK, which is used to write Java programs, and the RE (runtime environment), which is used to actually run Java programs. Are you sure that you installed the RE instead of the SDK?

like image 29
Kevin Avatar answered Sep 30 '22 01:09

Kevin