Community
Participate
Working Groups
This problem has caused me some grief while debugging, it is in the GM1 build. The debug gui changes the selected project to your first project in the debug configuration window after you select the "proper" project (while creating a new debug config)... Do the following to reproduce: 1) Go to java browsing perspective 2) Run->Debug... 3) Select "Java Application" 4) Click "New" 5) Enter a name 6) Pick a project (NOT THE FIRST PROJECT in the list) 7) Click on "include external jars" 8) Select a main class that is in an external jar 9) Click apply 10) Click "debug" or close & reopen the Debug configurations window 11) Select the debug configuration you created in step 5. Notice that the project has been re-set to the FIRST project in the list of projects. Step 10 will have failed with a ClassNotFoundException if you selected debug.... I looked everywhere EXCEPT the project the first time I encountered this problem. (Because I had already SET the project)
Deferred for post 2.0
Another required step for reproducing this problem: External jar in question needs to be included in the first project's libraries. It seems that we're computing a project for the config based on the first project which contains the config's main type. Why would we recompute the project instead of just using the project that is stored with the config?
marking as 2.1 candidate.
Actually, the problem has to do with searching for the main type. Following the given steps, notice that just after step 8 the project field is reset to the first project. This is because JavaMainTab tries to be helpful and fills in the project of the selected main type. The root of the problem is that the project of the main type returned from the dialog created with JavaUI.createMainTypeDialog() is set to the first project, despite the fact that the search scope passed in to the main type dialog contained only the second project. This is a bug in the code that searches for main types. Re-assigning to JDT/UI.
This is a JDT/Core problem. External Jars are shared and therefore have only one parent. The parent they get is the one for which the first get revealed. There is nothing we can do as long as Core keeps this sharing semantic. There is a separate bug in Core to resolve this issue. As soon as this is resolved the UI will behave "correctly". Closing since there is nothing UI can do.