Code Comments
Programming Forum and web based access to our favorite programming groups.I have a Java application and it requires various classes that are contained in JAR file to run. When I attempt to run the Java application at the command line with Java TodoList it returns an error that it cannot find the classes that are contained in the jar file. How do I allow the Java app to find the jar file and the classes within it? Thanks!
Post Follow-up to this messageDisregard. java -cp and path to jar file corrected the issue. "BoomerangThree" <JM@Hotmail.com> wrote in message news:10l1nirsv1hlpb0@corp.supernews.com... >I have a Java application and it requires various classes that are >contained in JAR file to run. > > When I attempt to run the Java application at the command line with Java > TodoList it returns an error that it cannot find the classes that are > contained in the jar file. > > How do I allow the Java app to find the jar file and the classes within > it? > > Thanks! >
Post Follow-up to this messageOk, getting a bit dense at this hour. Still having trouble getting my java application to find the jar file napkinlaf.jar: C:\Program Files\eclipse\workspace\ImportBonds>java ToDoList Exception in thread "main" java.lang.NoClassDefFoundError: napkin/NapkinLookAndFeel at ToDoList.main(ToDoList.java:104) I have tried placing the napkinlaf.jar in the same dir, and in a dir napkin with no luck. Can someone have pity on this poor soul??? "BoomerangThree" <JM@Hotmail.com> wrote in message news:10l1nirsv1hlpb0@corp.supernews.com... >I have a Java application and it requires various classes that are >contained in JAR file to run. > > When I attempt to run the Java application at the command line with Java > TodoList it returns an error that it cannot find the classes that are > contained in the jar file. > > How do I allow the Java app to find the jar file and the classes within > it? > > Thanks! >
Post Follow-up to this message"BoomerangThree" <JM@Hotmail.com> wrote in message news:<10l1p1mee9qj3a8@corp.supernews.com >... > Disregard. java -cp and path to jar file corrected the issue. > I am facing a similar problem - the error is as follows: Failed to load Main-Class manifest attribute from demo.jar When I double-click the jar file from windows, a dialog window(titled Virtual Machine Launcher)pops up saying: Couls not find the main class. Program will exit. This is happenning with all my jar files(including the demo ones that come with the SDK). Could you please give details of the above mentioned method(the exact command perhaps)? Or is it that something is wrong with my JRE? Thank you.
Post Follow-up to this messageOn 22 Sep 2004 03:35:49 -0700, Sambit Mukherjee wrote: > Failed to load Main-Class manifest attribute from demo.jar > > When I double-click the jar file from windows, a dialog window(titled > Virtual Machine Launcher)pops up saying: > Couls not find the main class. Program will exit. > > This is happenning with all my jar files(including the demo ones that > come with the SDK). Which of Sun's demos (path/file names) specifically? Many of Sun's .jars are not appropriate for 'double click launch'. Try the Jar you can download from here.. <http://www.physci.org/pc/property.jsp> It is the 'JTest' link directly below the title 'System Properties' If that loads OK when you double click it, it is not a problem with your JRE. -- Andrew Thompson http://www.PhySci.org/codes/ Web & IT Help http://www.PhySci.org/ Open-source software suite http://www.1point1C.org/ Science & Technology http://www.lensescapes.com/ Images that escape the mundane
Post Follow-up to this messageAfter many tries at the CLASSPATH I finally figured out the syntax. What I kept missing was that the path to my additional jar files requires ".;". So my batch file to run my app now looks like: SET CLASSPATH=.;C:\Program Files\eclipse\workspace\ImportBonds\napk inlaf.jar javaw ToDoList "Sambit Mukherjee" <sambitmukherjee@hotmail.com> wrote in message news:d6f2b0a1.0409220235.6b5ae249@posting.google.com... > "BoomerangThree" <JM@Hotmail.com> wrote in message > news:<10l1p1mee9qj3a8@corp.supernews.com>... > > I am facing a similar problem - the error is as follows: > Failed to load Main-Class manifest attribute from demo.jar > > When I double-click the jar file from windows, a dialog window(titled > Virtual Machine Launcher)pops up saying: > Couls not find the main class. Program will exit. > > This is happenning with all my jar files(including the demo ones that > come with the SDK). > > Could you please give details of the above mentioned method(the exact > command perhaps)? Or is it that something is wrong with my JRE? > > Thank you.
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.