Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Noob needs help with Hello World

 
Charles Way
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
author
Marshal
Pie
Posts: 21385
84
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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

Henry
 
Charles Way
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Pie
Posts: 49751
69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Greenhorn
Posts: 3
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for the advice, and I will do my best to keep my posts family friendly in the future.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic