I've been told by my tutor to run CMD open to directory that contains the JAR file...
like this example :
cd c:\JBuilder2\myclasses
To run WriteItemTest ...
java –classpath stockDemo4.jar stockDemo4.WriteItemTest
To run Main ...
java –classpath stockDemo4.jar stockDemo4.Main
I've also tried something I found while searching
C:\Users\User\Desktop\l2>java -jar l2.jar
I've tried these all but can't get it to run
Code:
C:\Users\User\Desktop\l2>java -classpath l2.java l2.Write
Exception in thread "main" java.lang.NoClassDefFoundError: l2/Write
Caused by: java.lang.ClassNotFoundException: l2.Write
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: l2.Write. Program will exit.
C:\Users\User\Desktop\l2>
I need to get what I created in jbuilder 3 to run without the need of jbuilder 3 I have the required software upto date.
my program has been created using the deployment wizard in jbuilder3 archive type setup as compressed Jar.
Thanks in advance for any help I get that get this test application working.
C:\Users\User\Desktop\jbuilder3\l2>java -classpath l2.jar lecture2.ShopV1
^^ ^^
Jar archive packageName.MainName
It now works also I got it working under cmd much easier than my tutor has explained in the workbooks, also making it an exe with the software is even easier but now I got this solved I am very happy. Now I need to make sure the application saves and opens files as expected.
Signature/Avatar nuking: none (can be changed in your profile)
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum