This content has been marked as final. Show 9 replies
Cheers! Took me a while but i finally seen what was staring me in the face!
Just for anyone else who has the same problem, follow my instructions on how to get to enviornment variables. Under the System Variables, you should see one named 'Path', click on it, click edit, and insert your jdk1.5.0_02\bin directory in there(directories are separated by ; ).
Then restart your computer, and just as a final check on the command line type echo %PATH% which will give you a list of directories of which your jdk1.5.0_02\bin should be one. Thats it!
Thanks again Athena!
I have the C:\Program Files\Java\JDK\bin declared inIn the command prompt, CD to the java bin directory then enter "jar"
the Path variable but still doesn't work, is there
something else i can check to make the 'jar' works?
Most likely, if jar.exe exists then you did not correctly set the Path (or maybe did not open a new command prompt after setting the Path).
Absolutely true!!! all you need to do is restart the command prompt and the jar starts working like magic.
Just to rephrase and compile the solution for anyone who's struggling:
1. Start>Control Panel>System>Advanced>Environment Variables
2. Under System variables window, find "path"
3. There are more than one paths defined there, so make sure you don't erase the previous ones, and add the new link to your jdk..\bin to this location. e.g. C:\java\jdk1.5.0_06\bin (this was mine, it can be different according to the OS and version, so check first)
4. Restart the Command Prompt
5. To check you got the path listed, do "echo %path%" on the command prompt.
6. run the "jar" command and it should work.
Make sure your PATH variable is set correctly. It depends on how you installed the JDK. I used the default values: c:\sun\sdk\jdk\bin. I ran into the same problem because PATH was modified automatically when I installed the JDK, but "jdk" was left out. Explore your JDK folder make sure PATH is pointing to the "bin" folder under the "jdk" folder, which has bin, demo, docs, include, jre, and lib folders.