NoClassDefFoundError

Hm... I generate a new project and a new Java file. Its got the basics and nothing but:

publicclass client{

publicstaticvoid main(String[] args){

}

}

So I compile it: javac client.java

Look, no complaints! Awesome! Run it!

java client.

Exception in thread"main" java.lang.NoClassDefFoundError: client

What? How? Who? Heeeeeeeeeeeeeeeeeelp!

I've got J2SE and J2EE installed by the way...

[754 byte] By [yitzlea] at [2007-10-2 20:09:15]
# 1
Try:> java -classpath . clientIf that works then it's because you have a problem with your CLASSPATH environment variable.Regards
jfbrierea at 2007-7-13 22:49:45 > top of Java-index,Java Essentials,New To Java...
# 2
Works now. Is the '.' the same as '.\'?And what should my CLASSPATH be pointing at?Thanks!
yitzlea at 2007-7-13 22:49:45 > top of Java-index,Java Essentials,New To Java...
# 3
What is the content of your CLASSPATH?
jfbrierea at 2007-7-13 22:49:45 > top of Java-index,Java Essentials,New To Java...
# 4
[blah]\jre1.5.0_05\lib\ext\QTJava.zipI also have J2EE installed, though...
yitzlea at 2007-7-13 22:49:45 > top of Java-index,Java Essentials,New To Java...
# 5

Get rid of [blah]\jre1.5.0_05\lib\ext\QTJava.zip in the CLASSPATH system environment variable. Even better get rid of the CLASSPATH system environment variable.

I would personally also get rid of the QTJava.zip file located under [blah]\jre1.5.0_05\lib\ext.

All those things were installed by QuickTime.

But QuickTime doesn't need those things to work properly.

Regards

jfbrierea at 2007-7-13 22:49:45 > top of Java-index,Java Essentials,New To Java...
# 6
Thanks...How did QuickTime get in there? QT isn't running mostly... *grumble*So having an empty/non existant classpath will make it work? Off to test...
yitzlea at 2007-7-13 22:49:45 > top of Java-index,Java Essentials,New To Java...
# 7

I usually use bluej so I didn't notice this error until I had to use jflex on the command line.. It seems that altough I have my classpath set correctly if I use java -classpath . client i get: could not create Java virtual machine

btw my classpath is C:\j2sdk1.4.2_04\bin

Message was edited by:

me1357

me1357a at 2007-7-13 22:49:45 > top of Java-index,Java Essentials,New To Java...