Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 330771 - Run last launched disappears
Summary: Run last launched disappears
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 3.7   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Debug-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-22 03:16 EST by Behrang Saeedzadeh CLA
Modified: 2011-05-13 01:43 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Behrang Saeedzadeh CLA 2010-11-22 03:16:49 EST
Build Identifier: 20100917-0705

When Eclipse starts-up in a clean brand-new workspace, there's a menu item under Run called "Run Last Launched". As its name suggests, it used to run the last launch config.

Now:

1- Create a Java project.
2- Create a class that has a main method
3- That menu item is still named "Run Last Launched"
4- Run the current file either by selecting Run As > Java Application or by pressing Run Last Launched
5- Now the menu item (ironically) is renamed to Run
6- Create a new class that also has a main method and select its editor
7- Now there's no way to run the last launched class (the menu item is renamed to Run and runs the class in the active editor)

Reproducible: Always

Steps to Reproduce:
1- Create a Java project.
2- Create a class that has a main method
3- That menu item is still named "Run Last Launched"
4- Run the current file either by selecting Run As > Java Application or by pressing Run Last Launched
5- Now the menu item (ironically) is renamed to Run
6- Create a new class that also has a main method and select its editor
7- Now there's no way to run the last launched class (the menu item is renamed to Run and runs the class in the active editor)
Comment 1 Ayushman Jain CLA 2010-11-22 03:21:51 EST
Moving to JDT/Debug
Comment 2 Michael Rennie CLA 2010-11-22 11:02:24 EST
As strange as it may sound this is working as designed. Let me explain.

The action in question is contributed with the name 'Run Last Launched' (there are also ones for Debug and Profile Last Launched). After the workbench starts and the debug.ui bundle is loaded the name will be updated based on your current context launching settings.

For example, if you turn off the setting on the Run/Debug > Launching preference page for context launching (select the 'Always launch the previously launched application' setting) the name will remain unchanged and always run the last launched configuration. If you leave the preference setting to its default the action has its name updated to Run... (Debug... and Profile... respectively) and will now launch the current context (editor, project explorer selection, etc) or fall back to running the last launch if a context cannot be resolved.

> 7- Now there's no way to run the last launched class (the menu item is renamed
> to Run and runs the class in the active editor)

I'm not sure what you mean here. You can run the last launched class by:

1. selecting it from the launch history
2. pressing the run / debug button after selecting the first editor
3. using the run / debug keybinding after selecting the first editor
4. using the Run As / Debug As popup menu items after selecting the first editor

steps 2 - 4 also work if you select the class from the outline view or any of the Package / Project explorers

The other option is that you can disable context launching altogether using the option mentioned above on the Run/Debug > Launching preference page.

Marking WORKSFORME.
Comment 3 Behrang Saeedzadeh CLA 2011-05-13 01:43:07 EDT
This is not resolved. Refer to this: https://bugs.eclipse.org/bugs/show_bug.cgi?id=345683