Hi,
When I try to run the simple 'jar' command on the Windows terminal I get the following error:
'jar' is not recognized as an internal or external command, operable program or batch file.
I have the latest JDK version installed, any ideas?
Thanks
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
Hi,
When I try to run the simple 'jar' command on the Windows terminal I get the following error:
'jar' is not recognized as an internal or external command, operable program or batch file.
I have the latest JDK version installed, any ideas?
Thanks
That looks like a message from the OS saying it can not find the jar command. Windows uses the contents of the PATH environment variable to find commands. If the folder with the jar command is not in the PATH variable, the OS can't find it.not recognized as an internal or external command
Either add the path to the jar command to the PATH
or use the full path to the jar command when you try to execute it.
If you don't understand my answer, don't ignore it, ask a question.
Ok I see. I'm not sure where the jar command is located in Windows, it comes with the JDK package, right?
I'm using a tutorial to create a jar file with a bundle of java classes, but I came across this jar command problem, so therefore I have no idea about this jar command in the first place
Thanks
Find where the JDK is installed and use the OS's search function to find the jar command.
If you don't understand my answer, don't ignore it, ask a question.
Yea I came across a Java folder in Program Files, and in the Java folder there is another folder called jre6. I did a search on jar, which resulted files that ended with the .jar extension. But there was no jar.exe command file? What is the standard representation of the jar command (name and extension type of file)?
Thanks
It should be in the JDK folders, not the jre
If you don't understand my answer, don't ignore it, ask a question.
I cant seem to find the any JDK folders? I only have the jdk6***-64.exe file which I installed before, but no folders?
Thanks
If you don't have a JDK installed, you won't have the jar command.
If you don't understand my answer, don't ignore it, ask a question.
Thanks for your time. Although I do have the JDK installed as I've been writing java programs with this computer.
Thanks
If you have the JDK installed, the jar command file is in the same folder as the javac command
If you don't understand my answer, don't ignore it, ask a question.
I can't even find the javac command anywhere on my computer. Is there a link to download the jar command? I've searched, but no positive sites.
Thanks
Do you compile them on that computer? What command does the compilation?I've been writing java programs with this computer.
If you don't understand my answer, don't ignore it, ask a question.
Yes i compile them on this computer. I use Jgrasp to compile them?
Thanks
Does it use the javac command to do a compile?
If you don't understand my answer, don't ignore it, ask a question.
I don't think so. I just click the 'Run' button on the Jgrasp IDE and it then returns the result on the JGrasp console. I don't use the command terminal for compilation.
Thanks
Read the API doc and FAQ for the IDE to see how it works.
If you don't understand my answer, don't ignore it, ask a question.
the problem is likely that you have set the path of jdk in the environment variable. i believe you are using window 7. if this is so, follow this simple steps if you have successfully installed your jdk
firstly, you need to know where your jdk is located on your system. you can find this by tracing it doing
go to your local disk, then to program files, then to java, then to jdk, then to bin.
you copy the path to be like this, c:\program files\java\jdk1.7.0_09\bin
note: the version of the jdk may vary.
secondly, go system properties, then to advanced system settings, then to environment variable, then under system variable locate path and click on "edit" just tab the front arrow key to make sure you didnt clear the highlighted directory
now, append a semicolon followed by the copied path in step one.
then click ok.
--- Update ---
the problem is likely that you have not set the path of jdk in the environment variable. i believe you are using window 7. if this is so, follow this simple steps if you have successfully installed your jdk.
firstly, you need to know where your jdk is located on your system. you can find this by tracing it as follows
go to your local disk, then to program files, then to java, then to jdk, then to bin.
you copy the path to be like this, c:\program files\java\jdk1.7.0_09\bin
note: the version of the jdk may vary.
secondly, go system properties, then to advanced system settings, then to environment variable, then under system variable locate path and click on "edit" just tab the front arrow key to make sure you didn't clear the highlighted directory
now, append a semicolon followed by the copied path in step one.
then click ok.
Thanks for your reply.
Yes that worked, thanks alot. See computer has two 'Program Files' folders (Program Files and Program Files (x86)) for some odd reason, and I was looking in the (x86) folder, but was located in the original folder. Thanks again for your help