Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can't even run a "Hello World" program

 
Jools Birch
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can compile but can't even run a "Hello World" program.

The CLASSPATH and PASS are correct.
When i run the .class file I get this message:
Exception in thread "main" java.NoClassDefFoundError: saluton (wrong name: Saluton)
at java.lang.ClassLoader.defineClass()(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.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 java.lang.ClassLoader.loadClassInternal(Unknown Source)

Please help me as this is very frustrating, I've read tutorials elsewhere and they either don't explain specifically this error or it is too hard for me to understand.
Thanks.
 
Jessica Sant
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no worries -- you've come to the right place.
Remeber: Java is case-sensitive. Meaning the word blah is different than Blah is different than BLAH.
So.... lets look at your error message:
Exception in thread "main" java.NoClassDefFoundError: saluton (wrong name:Saluton)
When you try to execute the class, make sure you use the correct case:
javac Saluton.java
java Saluton
Let us know if you have any more problems!
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mr. Fortran,
We don't have many rules round these parts, but we do have our naming policy, which doesn't allow obviously made-up names. Most of us here use our real names, anyway, but it should at least sound real. Please head over here and change yours right away.
Thanks, parder, and hope to see you round the Ranch!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic