• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Exception in thread "main" java.lang.NoClassDefFoundError

larva

Member
I installed J2SDK1.4.0 and J2EE server also. When I run
the simple program just "HelloWorld", I got the
error like that
Exception in thread "main" java.lang.NoClassDefFoundError : HelloWorld
Can somebody help to solve this problem Please?

Thanks !
 
Hi,

The filename is exactly the same as the public class name. My program is as follows:

import java.util.*;

public class HelloWorld
{
public static void main (String [] args)
{
String a[] = {"1","2"};
System.out.println(a.length);

}

}

filename : HelloWorld.java
 
You've probably got a classpath problem.

Make sure that your classpath includes the current working directory: .

If it doesn't then you'd want to run it this way: java -classpath . HelloWorld
 
Back
Top