• Post Reply Bookmark Topic Watch Topic
  • New Topic

installed jdk1.7.0_15, but getting error during java hello execution in cmd  RSS feed

 
ans pc
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have installed jdk1.7.0_15 in c:\program file\java folder from oracle site.
It is installed on windows 7 machines.I have selected 64 bit version.
I set path variable also.
With javac hello.java
Hello.class file is created in current work directory.
But java hello file gives following error :


Exception in thread "main" java.lang.NoClassDefFoundError: hello (wrong name: He
llo)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)

I read solution to add \jre\lib\ext in same /jdk1.7.0_15 folder.
But it is also present on jdk folder.
Please guide me for same

Thanking you
 
Campbell Ritchie
Marshal
Posts: 56570
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch
The error message tells it all. Wrong name: Hello. If you write hello, you won’t get the Hello class.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!