This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to run a project on Eclipse

 
Gary Ba
Ranch Hand
Posts: 161
Firefox Browser Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have just recently downloaded Eclipse on windows XP. I also grabbed a program online and used Eclipse to debug it. That worked fine until I started making code changes.
I changed the class name and for some reason I cannot run/debug the project anymore. Does anyone know what I need to set to run/debug on Eclipse - Helios. Please help.

Thank you,
Garry
 
Christophe Verré
Sheriff
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it a standalone application ? What is your main class ? Right-click on it, select Run As..., Java Application.
 
Tom Reilly
Rancher
Posts: 618
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you getting a compiler error? A runtime error? What happens if you change the class name back to the original name? Did you change a public class name? If so, did you rename the file that contains it? They must be the same.
 
Gary Ba
Ranch Hand
Posts: 161
Firefox Browser Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I copied and paste the old files with the old file and class names. Opened those files from Eclipse and it worked.

If I used the new files with the new names, it ask me to Run As Ant Build... or Ant Build. I selected one of them but nothing happens.

I am not getting a compile error. It is set up to 'build automatically'.

I tried to right where the main method is but the option "Run As.. Java Application" is not available.

Garry
 
Christophe Verré
Sheriff
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gary Ba wrote:Opened those files from Eclipse and it worked.

Did you create a new Java Project ? You need to create a Java project first, and import your files using File/Import.
 
Gary Ba
Ranch Hand
Posts: 161
Firefox Browser Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh ok. I finally got it right! I had to create a project. Dough! Completely forgot about it...

Thank you guys,
Gary
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic