khadije
khadije

Reputation: 55

Wrong project is being run in Eclipse

I wrote some java code in Eclipse. When I run it, I see the output of another project (that I wrote before) in the console. How can I see the output of my new code?

Upvotes: 5

Views: 18080

Answers (2)

Andres
Andres

Reputation: 10707

Trying to guess your problem: When you press the Run as button (White arrow in green circle), Eclipse doesn't run the program you're editing. Instead, it runs again the last program you executed. That's the reason why you see the output of another project: You're telling Eclipse to repeat its execution.

So, to run your new app, right click over the code and select Run as/Java application.

Upvotes: 4

Ravin Sardal
Ravin Sardal

Reputation: 727

Right click your project in the project explorer. And then this menu will pop up: enter image description here

Click Run As > Java Application

Upvotes: 1

Related Questions