Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse running previous program

Tags:

eclipse

It is a new problem. I copy paste a program and try to run it in eclipse. But the eclipse keeps running an older program. I have no idea what is going on. ( I saved the program as someone on the internet suggested) In the run button, there are only old programs. So I goes into the run configuration option and double clicked the java application option and somehow the one I am working on right now appeared. And I am able to compile and run the current one. So technically I solved the problem, but I would like an explanation, what was going on?

enter image description here

like image 368
jxhyc Avatar asked Jan 08 '23 07:01

jxhyc


1 Answers

What is going on here is how Eclipse decides what to Run when you press the Run button. My suspicion is you have settings which are causing it to launch the last launched item, rather than something new that does not have a launch configuration. If you hover over the Run icon, it will show the name of the launch configuration that Eclipse will launch.

For a new program, you want to do a Run As -> Java Application (From Run menu).

To configure the default launching behaviour, see Preferences -> Run/Debug -> Launching, and then set the options you want in the Launch Operation group.

launching preference page

like image 172
Jonah Graham Avatar answered Jan 11 '23 02:01

Jonah Graham