Eclipse IDE's Hello World Cheatsheet seems to have a mistake
Just a warning: I'm completely new to Java and am trying to teach myself Android programming.
I installed the Eclipse IDE today and tried to walk through the first Java Hello World "cheat sheet," and it didn't work! I was really quite surprised.
When it asked me to select the checkbox to create the main() method, there wasn't anything开发者_Go百科 on-screen that looked like a checkbox with "main()" or "method" next to it, so I guessed that maybe what they meant was the "Modifiers" radio button. So I left that checked for "public."
It didn't compile and I got red X's next to every folder in my Package Explorer.
Has anybody else had this problem?
Thanks!
When you create a class is there a section that asks:
Which method stubs would you like to create?
check the box labeled
public static void main(String[] args)
Edit: Also, it may be the case that you created an Interface
instead of a Class
, which may explain why you didn't see this option, if it actually wasn't there.
I just went through it, and it is correct. You should have seen those instructions when looking at a dialog called "New Java Class", which is on the step "Create your HelloWorld class". There is a checkbox under "Which method stubs would you like to create?" labeled "public static void main(String[] args)". That's the one the cheat sheet is referring to.
public static void main(String[] args)
精彩评论