Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How do you execute a JAR file?

807599Jan 28 2007 — edited Mar 18 2007
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'ing 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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 15 2007
Added on Jan 28 2007
18 comments
368 views