Hello all,

I have a small helloworld program and try to run it on the command prompt.

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

i have my file in C:\test\Hello.java

C:\test>javac Hello
creates a class file in c:\test\Hello.class

but

c:\tets>java Hello gives me NoClassDefFoundError

I have set classpath,jre_home,JAVA_HOME,path all environmetal variables.

Is there anything missing?

My OS is windows7,
JDK 1.6

Please help me..
its urgent

thanks
selsium

you should say

javac Hello.java // You forgot the extension

By the way, your post is not formatted at all, makes it hard to understand and reply.

No I dint miss it. Still the problem exists. class file is created thats is not a problem.

while i put my class file in JAVA_HOME/lib and
java Hello gives me output correctly..

I just try to run a Java program thats all.

I have used only Eclipse now I have use command prompt thats why this problem.

you should say

javac Hello.java // You forgot the extension

By the way, your post is not formatted at all, makes it hard to understand and reply.

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.