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

nivk picture nivk · Nov 14, 2013 · Viewed 398.5k times · Source

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

Answer

Riggs picture Riggs · Jul 8, 2014

you can use the command prompt:

javaw.exe -jar yourfile.jar

Hope it works for you.