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?
Your run configuration is wrong. Under the Run menu there's a Run Configurations option. That defines the various run configs for your projects. You need to add a new one that runs whatever it is you're interested in. Run configurations are also accessible by right-clicking in a Java source file, selecting Run As..., and Run Configurations.
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.
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.
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.
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.
Right click your project in the project explorer. And then this menu will pop up:
Click Run As > Java Application
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With