Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 82750 - JDT: Adding an external jar in Classpath in Launch Configuration produces a buggy classpath variable
Summary: JDT: Adding an external jar in Classpath in Launch Configuration produces a b...
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Debug-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-13 10:08 EST by jürgen schmitz-foster CLA
Modified: 2005-01-31 09:18 EST (History)
0 users

See Also:


Attachments
Error dialog when running the launch configuration with the added jar (251.34 KB, image/bmp)
2005-01-13 10:14 EST, jürgen schmitz-foster CLA
no flags Details
The classpath after running the changed launch configuration (358.27 KB, image/bmp)
2005-01-13 10:15 EST, jürgen schmitz-foster CLA
no flags Details
The classpath after adding them with "Add External Jars" (349.40 KB, image/bmp)
2005-01-19 09:58 EST, jürgen schmitz-foster CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description jürgen schmitz-foster CLA 2005-01-13 10:08:15 EST
I selected the Run/Run... menu, selected a Java application, selected the
Classpath tab in the Run dialog and added an external jar to the User Entries.
They first appear fine with the absolute path name, e.g.
c:\java\project\jars\xxx.jar. I apply the changes and start the application.
That results in a launch error dialog telling me that there is no such jar found
at \project\jars\xxx.jar

When I open up that classpath tab again, it now shows me the buggy path. Somehow
it got changed when starting my application.

I'm using Eclipse with the JDT plugin Version 3.0.1, Build 200409161125
Comment 1 jürgen schmitz-foster CLA 2005-01-13 10:14:15 EST
Created attachment 17134 [details]
Error dialog when running the launch configuration with the added jar
Comment 2 jürgen schmitz-foster CLA 2005-01-13 10:15:14 EST
Created attachment 17135 [details]
The classpath after running the changed launch configuration
Comment 3 Olivier Thomann CLA 2005-01-13 10:25:15 EST
Move to JDT/Debug.
Comment 4 Darin Wright CLA 2005-01-19 09:01:56 EST
When a jar is added to the runtime classpath as an "external" jar, but 
actually exists in the workspace as a resource, it gets converted to a 
workspace relative path (happens in RuntimeClasspathEntry.getMemento()). 
However, I was able to launch when I did this in 3.1 - the jar was found to 
exist. Does the jar actually exist if your case?
Comment 5 jürgen schmitz-foster CLA 2005-01-19 09:49:07 EST
Hello Darin,
I had attached two screenshots to bugzilla showing the added classpath entries
after insertion resp. after starting the launch configuration. There paths
should have been the same but they were not!! Your mentioned conversion to a
workspace relative path seemingly didn't work.
Yes, the jars all exist at the shown locations of the first screenshot, as I
added them with the file browser that pops up when selecting the "Add External
Jar" button.
Btw. I don't understand what you mean with "exists in the workspace as a resource".

Cheers
Jurgen
Comment 6 jürgen schmitz-foster CLA 2005-01-19 09:53:35 EST
Sorry, I DID NOT include the first screenshot after adding a new jar. But I will
do so right now...
Comment 7 jürgen schmitz-foster CLA 2005-01-19 09:58:40 EST
Created attachment 17277 [details]
The classpath after adding them with "Add  External Jars"
Comment 8 Darin Wright CLA 2005-01-19 10:26:24 EST
It looks like the jar is actually present as a file in the root folder of your 
project "importintercept". Thus, rather than adding the jar as an "external 
jar" (a file in the local file system), it should be added as a "jar from the 
workspace" (Add JARs... button). I'm not able to reproduce the "file does not 
exist" error. 

Which build of Eclispe are you using?
Comment 9 jürgen schmitz-foster CLA 2005-01-19 11:10:36 EST
Eclipse Build 200409161125
The jars which are 3rd party, are actually located in my project's root
directory as you guessed correctly. But does that already make it mandatory for
using Add JAR instead of Add External JAR? I mean it's just a location.
Anyway, I found a workaround by configuring the libraries in the project
properties Java buildpath the same way and then restoring the classpath in the
launch configuration to the default settings which are obviously taken from that
build path.
Well, if you have the time, could you write to me, how you create a launch
configuration with jars, then I could just do the same and see where the
differences are between your test and my launch configuration.
Comment 10 Darin Wright CLA 2005-01-31 09:18:49 EST
The problem is that the Java launcher cannot tell the difference between 
an "external jar" and an "internal jar" (resource in the workspace), when the 
jar is located in the workspace. It uses the location to determine if the jar 
is a resource or an external file in the local file system.