Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Noob needs help with Hello World

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
author
Posts: 23912
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Marshal
Posts: 74777
336
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic