I just finished a little java program for a homework assignment and I'm having trouble creating the jar file to bring to class.I usually do my work in the lab (at UNCA) on their computers that use Linux, so I haven't encountered this problem before. Right now I'm on my home computer which uses Windows XP.Anyways, here is my syntax using the command prompt, please let me know what you think is wrong. I can't figure it out:C:\Documents and Settings\Owner>jar cf Homework3.jar My Documents\NetBeansProjects\Homework3'jar' is not recognized as an internal or external command, operable program or batch file.
2/6/2008 10:19:47 PM
make sure the path to the java binaries is in the PATH= environment variablecontrol panel > system > advanced > environment variablesit makes baby jesus sad that you don't know something as simple as this, yet you're programming in java]
2/6/2008 10:21:50 PM
Thanks for the reply.I'm a little confused what should be where...Under the Environmental Variables I have the following:CLASSPATH.;C:\Program Files\Java\j2re1.4.2_09\lib\ext\QTJava.zipandPATH%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\ATI Technologies\ATI Control Panel;C:\Program Files\Common Files\Adaptec Shared\System;C:\Program Files\QuickTime\QTSystem\I'm assuming I need to edit the CLASSPATH??And if so, do I put the folder with all my NetBeans Projects at the CLASSPATH?
2/6/2008 10:34:40 PM
noadd this to the end of the PATH variable:;C:\Program Files\Java\j2re1.4.2_09\bin\(yes, include the semicolon)
2/6/2008 10:37:37 PM
does the jar binary even come with the j2re btw?
2/6/2008 10:40:28 PM
I'm not sure...I downloaded the recommended version, so I would think it includes everything I needed.I added that line to the PATH, but I got the same error from the command prompt.I appreciate the help, but honestly, it'll probably take more trouble than it's worth to help me out because I don't know what I'm doing. I'm going to just copy and paste the code from the program into an e-mail and redo it quickly tomorrow. And I think I'm going to try and bring my laptop to class to have a professor explain how to set this up.Thanks anyways though.
2/6/2008 10:53:57 PM
The directory containing jar.exe has to be in your PATH. The JRE does not include jar.exe. You have to download the JDK. Then add ;C:\Program Files\Java\jdk1.4.2_09\bin to your path (if that is where it installs to).
2/7/2008 12:43:47 PM
what happened to javac?
2/7/2008 3:33:08 PM
That's for compiling the code
2/7/2008 3:44:16 PM
random question insert...i'm a c# programmer (.net and asp) are jars the same thing basically as dll's? (not exactly, but that they serve the same purpose?)i've used java like once in my life[Edited on February 8, 2008 at 9:15 PM. Reason : .]
2/8/2008 9:14:32 PM
no.jar = java archive that contains code, among other thingsdll = compiled code
2/9/2008 12:07:14 AM
huh. well thats gayjava is for losers
2/10/2008 9:36:29 PM
2/10/2008 10:40:28 PM