Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Java Program wont run properly.
Java Program wont run properly. [message #642835] Thu, 02 December 2010 21:09 Go to next message
No real name is currently offline No real nameFriend
Messages: 3
Registered: December 2010
Junior Member
When I try to run my Java program, it automatically goes to the "Run As" window. In the window, there are only two options - "Ant Build" and "Ant Build..." How do I successfully run it? I do not have any "Ant" program.

[Updated on: Thu, 02 December 2010 21:10]

Report message to a moderator

Re: Java Program wont run properly. [message #642841 is a reply to message #642835] Thu, 02 December 2010 22:00 Go to previous messageGo to next message
David Wegener is currently offline David WegenerFriend
Messages: 1445
Registered: July 2009
Senior Member
Does the Java class that you are trying to run have a public static void main(String[]) method. If not, you can't run it.
Re: Java Program wont run properly. [message #643075 is a reply to message #642841] Fri, 03 December 2010 23:26 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 3
Registered: December 2010
Junior Member
Yes it does.
Here is the program:



public class tutorial_13_program_1 {
public static void main (String args[]) {
int counter = 0;

while (counter < 10) {
System.out.println (counter);
counter++;
}

}
}
Re: Java Program wont run properly. [message #643076 is a reply to message #643075] Fri, 03 December 2010 23:29 Go to previous message
No real name is currently offline No real nameFriend
Messages: 3
Registered: December 2010
Junior Member
I switched the workspace so now the same program works!
Thanks.
Previous Topic:classes compiled by Eclipse are different from classes using ANT build.xml file created by Eclipse.
Next Topic:problem Of Perm Gen Space
Goto Forum:
  


Current Time: Tue Mar 19 06:47:00 GMT 2024

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

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

Back to the top