Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / October 2006

Tip: Looking for answers? Try searching our database.

need help

Thread view: 
mustapha - 31 Oct 2006 12:55 GMT
hi everybody,

while trying to execute a java program I got this execption:
Exception in thread "main" java.lang.NoClassDefFoundError:
epsontest/EpsonTest

and this my script for launching jvm:
-------------------------------myscript.sh-------------------------------
#!/bin/bash
cd "/home/elec/epsontest"
"/usr/lib/jvm/java-1.5.0-sun-1.5.0.06/jre/bin/java" -classpath
"/home/elec/epsontest/EpsonTest.class":"/home/elec/epsontest/Step1Frame.class":"/home/elec/epsontest/Step1Frame$1.class":"/usr/lib/jvm/java-1.5.0-sun-1.5.0.06/jre/lib/ext/jpos19.jar":"/usr/lib/jvm/java-1.5.0-sun-1.5.0.06/jre/lib/ext/pos.jar":"/usr/lib/jvm/java-1.5.0-sun-1.5.0.06/jre/lib/ext/epsonupos.jar":"/usr/lib/jvm/java-1.5.0-sun-1.5.0.06/jre/lib/ext/uposcommon.jar":"/usr/lib/jvm/java-1.5.0-sun-1.5.0.06/jre/lib/ext/linuxUsbDriver.jar":"/usr/lib/jvm/java-1.5.0-sun-1.5.0.06/jre/lib/ext/xercesImpl.jar":"/usr/lib/jvm/java-1.5.0-sun-1.5.0.06/jre/lib/ext/xml-apis.jar"
epsontest.EpsonTest
-----------------------------------------------------------------------------
thanks in advance

best regards,
Gordon Beaton - 31 Oct 2006 13:14 GMT
> while trying to execute a java program I got this execption:
> Exception in thread "main" java.lang.NoClassDefFoundError:
> epsontest/EpsonTest

Don't specify individual classfiles in the classpath argument. Specify
the root of your package structure instead, i.e. /home/elec. There is
no need to specify jarfiles that already belong to the JVM, or
anything from the extension directory either.

Also, there is no need for *any* of the "quotation marks" in your script.
Quotation marks are only necessary to protect spaces or other
characters that have special meaning to the shell.

Probably this is sufficient to run your program:

/usr/lib/jvm/java-1.5.0-sun-1.5.0.06/jre/bin/java -classpath /home/elec epsontest.EpsonTest

/gordon

Signature

[ don't email me support questions or followups ]
g o r d o n  +  n e w s  @  b a l d e r 1 3 . s e

Sachin - 31 Oct 2006 13:17 GMT
Hi,
You don't want to specify the full path for the class file. Include
only the path to the directory which contains the root package.

Sachin.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.