×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




This is the "is it plugged in" question, but just in case you hadn't thought of it type:

qsh cmd('ls .')

And make sure the class file is actually where you're telling java it is through your classpath.

-----Original Message-----
From: java400-l-bounces@xxxxxxxxxxxx [mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of Peter Dow
Sent: Tuesday, July 19, 2011 1:35 AM
To: java400-l@xxxxxxxxxxxx
Subject: Re: NoClassDefFoundError: testjava.class

qsh cmd('pwd')

/home/pdow

qsh cmd('echo $CLASSPATH')

.:/java/dom4j/dom4j-1.6.1.jar:/java/poi3.7/poi-3.7-20101029.jar:/java/poi3.7/
poi-scratchpad-3.7-20101029.jar:/java/poi3.7/poi-ooxml-3.7-20101029.jar:/java
/poi3.7/poi-ooxml-schemas-3.7-20101029.jar:/java/xmlbeans/jsr173_1.0_api.jar:
/java/xmlbeans/xbean.jar

On 7/19/2011 2:06 AM, Gary L Peskin wrote:
Is /home/pdow your home directory? What happens if you type:

qsh cmd('pwd')

and

qsh cmd('echo $CLASSPATH')

?

Gary

-----Original Message-----
From: java400-l-bounces@xxxxxxxxxxxx [mailto:java400-l-
bounces@xxxxxxxxxxxx] On Behalf Of Peter Dow
Sent: Monday, July 18, 2011 10:39 PM
To: java400-l@xxxxxxxxxxxx
Subject: Re: NoClassDefFoundError: testjava.class

Same as before:

Exception in thread "main" java.lang.NoClassDefFoundError: testjava
Caused by: java.lang.ClassNotFoundException: testjava
at java.net.URLClassLoader.findClass(URLClassLoader.java:497)
at java.lang.ClassLoader.loadClass(ClassLoader.java:639)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:605)

On 7/18/2011 11:19 PM, Gary L Peskin wrote:
Try to take the ".class" off of your java command so it's

qsh cmd('java -classpath $CLASSPATH testjava')

HTH,
Gary

-----Original Message-----
From:java400-l-bounces@xxxxxxxxxxxx [mailto:java400-l-
bounces@xxxxxxxxxxxx] On Behalf Of Peter Dow
Sent: Monday, July 18, 2011 8:02 PM
To: Java Programming on and around the iSeries / AS400
Subject: NoClassDefFoundError: testjava.class

I have a java program testjava.java, which successfully compiles
into testjava.class.

Both of these are in my current directory, /home/pdow.

When I try to run the program with

qsh cmd('javap -s -public -classpath $CLASSPATH testjava.class')

I get the following error:

Exception in thread "main" java.lang.NoClassDefFoundError:
testjava.class Caused by: java.lang.ClassNotFoundException:
testjava.class
at java.net.URLClassLoader.findClass(URLClassLoader.java:497)
at java.lang.ClassLoader.loadClass(ClassLoader.java:639)
at
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:605)
--
This is the Java Programming on and around the IBM i (JAVA400-L)
mailing list To post a message email: JAVA400-L@xxxxxxxxxxxx To
subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx Before posting, please take
a moment to review the archives at http://archive.midrange.com/java400-l.

--
This is the Java Programming on and around the IBM i (JAVA400-L) mailing list To post a message email: JAVA400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/java400-l.




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.