Reputation: 1877
I'm getting the following error when I try to run the 'jar
' command in the command line on windows : 'jar' is not recognized as an internal or external command
.
There is a general guess that seems to be right that is I might have the PATH
environment variable incorrectly. But I have already done this, I added the following value to PATH
variable : 'C:\Program Files(x86)\Java\jdk1.8.0_25\bin
'.
I am running a 64 bit windows 8 system. I have also referenced this question from the following link: java 'jar' is not recognized as an internal or external command
I have also tried some of the solutions suggested in the above link, I couldnt add a comment there since my reputation is not much.
Suggestions that I have tried from the above link:
[1]https://stackoverflow.com/a/29180681/7639034
(From the above link, java -version and java -jar are also working. What is wrong with the jar file then?)
[2]https://stackoverflow.com/a/42492380/7639034
Upvotes: 4
Views: 27349
Reputation: 18133
Path variable should be pointing to bin
folder, that's where executable are stored. Currently you are having path only upto C:\Program Files(x86)\Java\jdk1.8.0_25
so you are getting error.
Create JAVA_HOME
environment variable which points to above location, and add %JAVA_HOME%\bin
to PATH
variable. It will work.
Upvotes: 9