I'm a beginner in JAVA and I'm facing a problem in executing a sample program.Let me explain it step by step:

1. The following program was written thru a notepad and then saved as Sample.java:

class Sample
{
public static void main(String args[])
{
System.out.println("Hello World!!!");
}
}

2. The above program is then compiled by rhe following command:

javac Sample.java

Successful compilation: a .CLASS file named as Sample.class was generated.

3.The following command was implemented for execution:

java Sample

An error message appeared:

Exception in thread 'main':java.lang.NoClassDef Found.Error:Sample

PLEASE HELP...........

Ohh, you have an environment variable issue. Check the java.sun site to get the latest info on how to correctly set your variables.

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.