0

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

Edited by __avd: Added [code] tags.

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by selsium
0

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.

0

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.

Edited by selsium: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.