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.