Hi!!!!!!

I am facing a problem at the run time of the java byte code.

I am using JDK 1.5 in OS Win XP on and i have installed it properly...

its compile time is working exactly i.e. javac command produces byte code

but when i use command java class-name (the class containing main method)

i got an exception

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

As i hope there is no problem of class path because java & javac are working.

There is no problem in setup of jdk 1.5 because it is working well in my OS WIN Millenium properly..

I also try by re installing JDK but i got no solution.:confused:

Please REPLY that how this problem can be solved AND WHAT SHOULD I DO ????...... :?:

Recommended Answers

All 2 Replies

Post code and the name of the file.
Also you probably need to set the classpath.

Member Avatar for harsh2327

The class containing main method should be public

public class abc {
.....
}

and the filename should be same as class name...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.