Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

java.lang.NoClassDefFoundError

Status
Not open for further replies.

jrookie

Technical User
Mar 17, 2003
2
US
Hi
I keep getting error below when running my program (readerwriterserver.java). It compiled without any problem though. Any suggestions?

OS: Win2k
Running jdk v1.2
Environment set = c:\jdk1.2\bin

Exception in thread “main” java.lang.NoClassDefFoundError: readerwriterserver/java

 
try setting your classpath when running your code, ie -

java -cp .;C:\ readerwriterserver

also make sure when running the command java that you don't have this:

java readerwriterserver.java

it should be

java readerwriterserver

hope this helps.
 
I had a similar problem, and although being a newbie @ this, found that it was because my class didn't actually do anything.
e.g. if you are making a swing window and dont intialise the container, logically nothing exists, so a class def error occurs.

I'm still in my first year of comp sci, and havn't covered the JVM in detail, but it basically means the JVM cant find anything to display/do...hope it helps. thought id just mention it.

Oxy we are all of us living in the gutter.
But some of us are looking at the stars.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top