I get the error mentioned above when I execute jar command in cmd. I tried to solve this problem by going putting the path of the jar.exe file in the "path" variable in My computer> > settings > advanced system settings > environment variables.
This is how i did it -
(old path variables here);C:\Program Files (x86)\Java\jdk1.7\bin\jar.exe
I saved the changes and tried to run jar in cmd again and got the same error. Please tell me my mistake and how to fix it. I need to make this work so that I can create jar files via the command line.
1 -Right click on the jar file and click on Open with and then click on choose another app. 5 – Select java.exe and click OK. If all of the above methods fail, search for jarfix program on Google and download it. This will instantly fix the issue.
If you do not have Java installed, and the PATH variable is not set correctly, attempts to run a JAR file on Windows or Ubuntu will result in a 'Java not recognized' error. To run a JAR file, you must install the Java JDK or JRE on your computer.
Double-click the JAR file. If it's executable and you have Java installed, it should open. If it doesn't open, proceed to the next step. You may see a pop-up window asking which program you want to use to open the file. If so, click Java(TM) and then click OK.
The path should only contain directories where the OS will look for executables. Strip the trailing "\jar.exe"
to set your path as:
(old path variables here);C:\Program Files (x86)\Java\jdk1.7\bin
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With