Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 200814

Summary: [search] Launching class from Library classpath entry creates config with wrong project
Product: [Eclipse Project] JDT Reporter: Aaron Tarter <ajtarter>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: Michael_Rennie, Olivier_Thomann
Version: 3.3   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: stalebug

Description Aaron Tarter CLA 2007-08-22 08:34:20 EDT
Build ID:  I20070601-1539

Steps To Reproduce:
1. Create a Java Project A and add an external JAR to the project's build path.  The JAR should have a class with a main function.
2. Create a Java Project B and add the same external JAR referenced by A to B's build path
3. In the package explorer, expand the JAR under project B and right-click on the class with the main function, then select run as Java application.
4. A launch configuration is created for project A instead of project B from which you launched.  Since the project field for the launch config is A, the working directory for the launch is under A as well.  


More information:
Comment 1 Olivier Thomann CLA 2007-08-22 08:49:06 EDT
Moving to JDT/Debug
Comment 2 Olivier Thomann CLA 2007-09-10 15:30:43 EDT
The problem comes from the fact that the JavaSearchScope doesn't remember that the referenced external jars comes from the project's B build path.
Project B is in the projectPaths internal field, but there is no way to retrieve it.
If the scope returns project B as part of the enclosingProjectsAndJars array, then the expected behavior works.
Comment 3 Jerome Lanneluc CLA 2008-05-07 18:28:31 EDT
Deferring post 3.4
Comment 4 Eclipse Genie CLA 2020-03-14 01:49:13 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.