Skip to main content



      Home
Home » Newcomers » Newcomers » Crash And Burn on Hello World Tutorial(Multiple Markers at this line)
Crash And Burn on Hello World Tutorial [message #1691290] Sat, 04 April 2015 14:38 Go to next message
Eclipse UserFriend
How pathetic is this? Should I have done "Goodbye cruel world" app instead?

I used Eclipse in the past developing Java at a job and decided to spin the included tutorial to get back up to speed on the IDE.

After entering this:
public class HelloWorld {
System.out.println("Hello world!");
}


And clicking run, I got red underlines under second '.' and "Hellow world!"

With the tooltip red x saying: "Multiple markers at this line
- Syntax error on token ""Hello world!"", delete
this token
- Syntax error on token(s), misplaced construct(s)"
Re: Crash And Burn on Hello World Tutorial [message #1691296 is a reply to message #1691290] Sat, 04 April 2015 17:52 Go to previous messageGo to next message
Eclipse UserFriend
I'm not sure which tutorial you mean, but executable code has to go inside of methods rather than just being jammed into the class body, as shown partway through http://www.coderanch.com/how-to/java/how-to-create-java-program . You might want to spend some time refamiliarizing yourself with the language.
Re: Crash And Burn on Hello World Tutorial [message #1691299 is a reply to message #1691296] Sat, 04 April 2015 19:41 Go to previous messageGo to next message
Eclipse UserFriend
This is the one right in Eclipse Luna 4.4.2 You click the "create java project" and "Create your hellowworld class" and "Add a print statement" from the welcome tab:

Now that you have your HelloWorld class, in the main() method, add the following statement:
System.out.println("Hello world!");
Then save your changes; the class will automatically compile upon saving.

To run your application, right-click on your class in the Package Explorer and select Run As > Java Application. The Console view should appear at the bottom and display the "Hello, world!" output.
Congratulations! You have successfully created a Hello World application!

Why do you think a highly developed IDE would leave out such an obvious thing in their own tutorial?

[Updated on: Sat, 04 April 2015 19:42] by Moderator

Re: Crash And Burn on Hello World Tutorial [message #1691300 is a reply to message #1691299] Sat, 04 April 2015 19:45 Go to previous message
Eclipse UserFriend
Never mind, I overlooked a small but obvious part of the instruction:

"Enter HelloWorld for the class name, select the checkbox to create the main() method, then click Finish."

That will teach me to skim read, maybe.
Previous Topic:"create remote" repository ?
Next Topic:eclipse hyperlink not working
Goto Forum:
  


Current Time: Tue May 20 09:38:39 EDT 2025

Powered by FUDForum. Page generated in 0.09938 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top