Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I solve the error : 'jar' is not recognized as an internal or external command, operable program or batch file?

Tags:

java

jar

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

like image 929
Code_Ninja Avatar asked Oct 15 '25 07:10

Code_Ninja


1 Answers

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.

like image 81
Pradeep Simha Avatar answered Oct 17 '25 19:10

Pradeep Simha



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!