|
Re: Problem launching java apps [message #514359 is a reply to message #514339] |
Sun, 14 February 2010 20:02   |
Eclipse User |
|
|
|
"Anton" <anton.shaykin@gmail.com> wrote in message
news:hl9e7u$ck7$1@build.eclipse.org...
> Hi all!
> I'm fairly new Eclipse user. Before I used only NetBeans, but now trying
> to migrate to Eclipse. I'm preparing for SCJP exam and using lots of
> examples from a book. So I created packages for every chapter of the book,
> and multiple packages for every example, each containing main() method.
> Everything worked well so far, but since recently I can't launch new java
> programs, that I write. I close all the tabs related to old stuff, and
> have only one active tab containing program with main, that I want to
> launch, but when I hit ctrl+f11 I get the output in my console from old
> programs. Any ideas what I'm doing wrong? The package hierarchy and code
> looks as follows (pay attention to the console output - that's actually
> output from another program):
> http://img687.imageshack.us/img687/6046/eclipseproblem.jpg
Hi, Anton. By the way, eclipse.newcomer is a better newsgroup for asking
questions about the basics of Eclipse.
In this case, I think your problem is that you don't actually have a main
routine. I know it looks like you do, but you don't :-) The "real" main()
routine needs to have a String[] parameter, like this:
static void main(String[] args) { ... }
When you create a new class in Eclipse, there's a checkbox to tell it to add
the main() routine automatically, and that way you won't have to worry about
getting it right.
Add a String[] param to your main routine and I think you'll be off and
running again.
|
|
|
|
Re: Problem launching java apps [message #514619 is a reply to message #514432] |
Mon, 15 February 2010 16:34  |
Eclipse User |
|
|
|
Anton wrote:
> What a shame! I tried to edit my question before someone else had seen
> it, but I didn't make it :) Of course I know main method's signature.
> The problem is that I often deal with C++, where main usually has no
> arguments. Anyway, thanks for your reply.
Trust me, you won't be the last person to make that mistake :-)
|
|
|
Powered by
FUDForum. Page generated in 0.27657 seconds