niti20
asked on
Exception in thread "main"
i have created a folder com. In this folder i have created the following file
package com; public class Hello { public static void main(String[] args) { System.out.println("Hello World!"); }}
I compile it using
D:\>javac com\Hello.java
But i am unable to run it. i get the following error
Exception in thread "main" java.lang.NoClassDefFoundE rror: com/Hello
when i do D:\>java com.Hello
Please help
package com; public class Hello { public static void main(String[] args) { System.out.println("Hello World!"); }}
I compile it using
D:\>javac com\Hello.java
But i am unable to run it. i get the following error
Exception in thread "main" java.lang.NoClassDefFoundE
when i do D:\>java com.Hello
Please help
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
java -classpath . com.Hello
To avoid having to specify it on the command line then add d:\ to your CLASSPATH environment variable