Hello AmanSingh, It seems you have not changed the path name of the directory. >From which you have called the jar command please change the path name in the configuration files. And error itself is self explanatory.
On Fri, Feb 24, 2012 at 10:23 PM, Sang Shin <[email protected]>wrote: > On 2/24/2012 9:02 AM, Amandeep wrote: > >> Hello, >> >> I followed your tutorial in “..Java Programming/Tools/JAR/javase_**jar/ >> index.html#2.4” exercise 2. >> The jar file gets created successfully but when I execute it, gives >> following error >> >> C:\Users\am009si\Documents\**NetBeansProjects\helloworld>**jar cvfm dist/ >> my_jar_app. >> jar src/mymanifest.mf -cp build >> -cp : no such file or directory >> added manifest >> adding: build/(in = 0) (out= 0)(stored 0%) >> adding: build/mypackage/(in = 0) (out= 0)(stored 0%) >> adding: build/mypackage/Main.class(in = 844) (out= 510)(deflated 39%) >> > > Somehow the command syntax is wrong. And it is hard to tell from what you > wrote above. > Also here is a dot missing at the end of the command. > > Try to run the solution first and see if it works. > > -S > > > C:\Users\am009si\Documents\**NetBeansProjects\helloworld>**java -jar >> dist/ >> my_jar_app >> .jar -cp build >> Exception in thread "main" java.lang.**NoClassDefFoundError: mypackage/ >> Main >> Caused by: java.lang.**ClassNotFoundException: mypackage.Main >> 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: mypackage.Main. Program will exit. >> >> also below is the manifest file contents: >> Manifest-Version: 1.0 >> Main-Class: mypackage.Main >> >> Please help!! >> >> > > -- > ------------------------------**------------------------------**------- > Sang Shin, [email protected] > Founder and Chief Instructor of JPassion.com > JRebel/LiveRebel Evangelst from ZeroTurnaround.com > http://JPassion.com/portal/**instructors/sang-shin-schedule<http://JPassion.com/portal/instructors/sang-shin-schedule>(Bio) > > http://www.javapassion.com/**webinars<http://www.javapassion.com/webinars>(Webinars) > > http://www.linkedin.com/in/**javapassion<http://www.linkedin.com/in/javapassion>(Linkedin) > http://twitter.com/javapassion (Tweeter) > Life is worth living... with Passion! > ------------------------------**------------------------------**---------- > > > -- > You received this message because you are subscribed to the Google Groups > "JPassion.com: Java Programming" group. > To post to this group, send email to [email protected]**. > To unsubscribe from this group, send email to jpassion_java+unsubscribe@** > googlegroups.com <jpassion_java%[email protected]>. > For more options, visit this group at http://groups.google.com/** > group/jpassion_java?hl=en<http://groups.google.com/group/jpassion_java?hl=en> > . > > -- You received this message because you are subscribed to the Google Groups "JPassion.com: Java Programming" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/jpassion_java?hl=en.
