0

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

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

(also i copied it if thats okay >-<)

  • 1
    to run Java, you need to include the `bin` directory in the `PATH` - see: https://www3.ntu.edu.sg/home/ehchua/programming/howto/JDK_Howto.html – blurfus Oct 18 '20 at 18:25
  • Also, you can open a `.jar` file with any Zip tool (WinZip, 7zip, etc) as it is just a compressing format – blurfus Oct 18 '20 at 18:26
  • 1
    Does this answer your question? ['Java' is not recognized as an internal or external command](https://stackoverflow.com/questions/15796855/java-is-not-recognized-as-an-internal-or-external-command) Did you try Googling the error message before posting your question? – Abra Oct 18 '20 at 18:38

1 Answers1

0

That's because you didn't set JAVA/bin path into environment variables.

Anyway, you can right click the .jar ->Open with... and open the explorer. Go to the java path/bin and select javaw.exe to open with.

Stefano Leone
  • 635
  • 5
  • 14