need help

M

mustapha

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
 
G

Gordon Beaton

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
 
S

Sachin

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top