Community
Participate
Working Groups
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
Created attachment 17134 [details] Error dialog when running the launch configuration with the added jar
Created attachment 17135 [details] The classpath after running the changed launch configuration
Move to JDT/Debug.
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?
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
Sorry, I DID NOT include the first screenshot after adding a new jar. But I will do so right now...
Created attachment 17277 [details] The classpath after adding them with "Add External Jars"
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?
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.
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.