wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Noob needs help with Hello World Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Noob needs help with Hello World" Watch "Noob needs help with Hello World" New topic

Noob needs help with Hello World

Charles Way

Joined: Sep 19, 2011
Posts: 3
I am a complete Noob at programming who has decided to start with Java. I am trying to run the Hello World script as follows.

Every time I try I get the "Error: Could not find or load main class HelloWorld."
This is probably something very simple that I am overlooking. Any help would be appreciated.
Henry Wong

Joined: Sep 28, 2004
Posts: 18553

The class is named "HelloWorldApp" -- not "HelloWorld", as the error message implies that you are using.


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Charles Way

Joined: Sep 19, 2011
Posts: 3
Thank you.

That fixed it.

I did not notice, and please excuse my language. I forgot that I had added my own colorful spin when I copied the code.
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 38107
Yes, this is a family website It is always before the 9pm watershed somewhere in the (Hello)world where somebody is logged on to the Ranch !

And welcome to the Ranch

Note I have edited your post, and you can see how much better it looks. For reasons explained here, you ought to use spaces, not tab characters, for indenting. Using a decent text editor (eg Notepad2, Notepad++ jEdit) instead of the editor that comes included with Windows® will make indenting much easier.
Charles Way

Joined: Sep 19, 2011
Posts: 3
Thank you for the advice, and I will do my best to keep my posts family friendly in the future.
Don't get me started about those stupid light bulbs.
subject: Noob needs help with Hello World
Similar Threads
hello world code
Fresh SDK Install Won't Compile?
Exception in thread "main" java.lang. NoClassDefFoundError: HelloWorldApp
Error by compiling textfile Could not find the main class: HelloWorldapp. Program will exit
packaging up Swing application into Jar file for distribution