How do you execute a JAR file?



I'm sorry this is so basic, but I honestly do not know how to do this
nor can I find anything online here or anywhere via Google to help me
with this one.

I have a JAR file that I created on another machine using JDK 1.6.0
and NetBeans 5.5 on WinXP.

I copied and pasted that JAR file over to my machine at home also
using JDK 1.6.0 and NetBeans 5.5 on WinXP

I put the exact directory name where the JAR file resides, "C:\Program
Files\Java\jdk1.6.0\classes", in CLASSPATH and rebooted my machine.

However, upon CD'*** to that directory and doing "java -classpath .
GUI.jar", I get a "NoClassDefFoundError" when trying to do so.

Furthermore, I was not sure how to use NetBeans to run the JAR file to
execute the classes within.

What did I do wrong? I'm so sorry this is so basic.

Thanx
Phil

.



Relevant Pages

  • help: deciphering netBeans install.log
    ... in linux I downloaded the JDK and it installed itself ... then i downloaded the netbeans .jar file, and, at the shell prompt, ...
    (comp.lang.java.softwaretools)
  • jar file wont run
    ... jaf (Java Activation Framework) 1.1.1 ... that I can both run from NetBeans. ... "The jar file "ProjectName.jar" couldn't be launched. ... Where can I finde the "console", what is it, can the solution to the ...
    (comp.lang.java.programmer)
  • Problem with JAR Files
    ... I am developing a small front-end utilizing the AbsoluteLayout layout ... which comes from NetBeans 3.5.1. ... My problem is attempting to run it all as a JAR file. ... I'm fairly new at Java and have been able to ...
    (comp.lang.java.programmer)
  • Re: command line stuff
    ... > I feel that having learned some very limited java through use of an ... > I've developed an app that requires a jar file to be mounted on the ... This is easily done in Netbeans but when I try using ... IDE portable because most IDE's support ANT. ...
    (comp.lang.java.help)
  • Re: Netbeans JAR file execution from command line
    ... Eventually I copied all the netbeans files into the sun java directory. ... What is the proper way to go about this? ... Rejar the NB classes* in your main jar file. ...
    (comp.lang.java.help)