java.lang.NoClassDefFoundError:
I am new to Java. I was able to run this yesterday - (after trying a gaziion classpath manipulations. I go to run it today - and i get the infamousjava.lang.NoClassDefFoundError:
error. My jars are in the classpath
echo $CLASSPATH
/java/jt400.jar:/java/msbase.jar:/java/msutil.jar:/java/mssqlserver.jar
$
It gets no more frustrating then this. Any help is appreciated. thank you in advance
[444 byte] By [
tbrown9a] at [2007-10-2 22:09:48]

Hello. Below is the full error. Here is a twist. I came in this morning - started my pc, went into Qschell - set my classpath as such :
export CLASSPATH=/java/jt400.jar:/java/msbase.jar:/java/msutil.jar:/java/m
ssqlserver.jar:
(directory java also contains the class i am trying to run - "Sqlweb400").
Then i ran Sqlweb400 - an dit worked fine. Iran 2 otehr classes - and no problem. Then I read that if you type "export" - it will show you all classes in the classpath. So i type that. I got nothing. BUT !!! - i go to reun my Sqlweb400 class (again) and i get (what i always get) the error message - here is the ful error - why woulkd this work once - but not again - this happened last week also. Here is tghe full message:
java Sqlweb400
java.lang.NoClassDefFoundError: Sqlweb400
at java.lang.Throwable.<init>(Throwable.java:195)
at java.lang.Error.<init>(Error.java:49)
at java.lang.NoClassDefFoundError.<init>(NoClassDefFoundError.java:40
Could it be that i hav eto qualify something as "new" - i don't know why it would work - and then not.. Thank you in advance for any help / tips.
I am not familiar with Classpath on *nix platforms so keep that in mind. It sounds like you are trying to launch a class that is in the current directory, which happens to be /java. However, the Classpath you posted does not contain . or /java. So I think you need to add .: to the start of the Classpath.
This does not explain everything you posted, but it's the best guess I have.
Hello, (1st thanks for your feedback). I had/had:
export CLASSPATH=/java/jt400.jar:/java/msbase.jar:/java/msutil.jar:/java/m
ssqlserver.jar:
java in the classpath - listed first - What i sso #$* confusing is it ran once - i got out - came back in - (to Qschell - to run java commands)
rest the classpath - then ran it (again) and i get:
java.lang.NoClassDefFoundError: JdbcTest1
at java.lang.Throwable.<init>(Throwable.java:195)
at java.lang.Error.<init>(Error.java:49)
at java.lang.NoClassDefFoundError.<init>(NoClassDefFoundError.java:40
> Hello, (1st thanks for your feedback). I had/had:
> export
> CLASSPATH=/java/jt400.jar:/java/msbase.jar:/ja
> a/msutil.jar:/java/m
> ssqlserver.jar:
> java in the classpath - listed first -
That does not put the /java directory into the classpath (if that's what you mean) - you must specify it directly./java:/java/jt400.jar:/java/msbase.jar:/java/msutil.jar:/java/mssqlserver.jar:
Yes, that was what i meant (sorry about the being fuzzy). more inportantly - Thank You a great deal. I have been going crazy. I am an old RPG/ILE programmer (with some VB/J/Script/PHP/MySql) but JAVA (for this knucklehead) is a large bridge to cross. I can't thank you enough. Your tip did the trick.
Have Great Day
Tom B. in New York