Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Problem launching java apps(multiple packages structure)
Problem launching java apps [message #514339] Sun, 14 February 2010 13:08 Go to next message
Eclipse UserFriend
Remove this topic please

[Updated on: Sun, 14 February 2010 15:02] by Moderator

Re: Problem launching java apps [message #514359 is a reply to message #514339] Sun, 14 February 2010 20:02 Go to previous messageGo to next message
Eclipse UserFriend
"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 #514432 is a reply to message #514359] Mon, 15 February 2010 05:32 Go to previous messageGo to next message
Eclipse UserFriend
What a shame! I tried to edit my question before someone else had seen it, but I didn't make it Smile 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.
Re: Problem launching java apps [message #514619 is a reply to message #514432] Mon, 15 February 2010 16:34 Go to previous message
Eclipse UserFriend
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 :-)
Previous Topic:JavaSourceViewer and autocompletion
Next Topic:Can I include Ant tasks as plugins for the Ant External Tools Dialog?
Goto Forum:
  


Current Time: Wed Mar 19 23:15:05 EDT 2025

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

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

Back to the top