How can I cause a Java Build Path Library to resolve a new Jar added Programatically? [message #243323] |
Tue, 01 May 2007 13:58  |
Eclipse User |
|
|
|
My Eclipse plugin has a builder which adds a jar file to a Project with
the Java Nature. The Java Project has a Java Build Path Library entry
for a lib folder in the project so that I can add jars to the lib dir
and not have to manually add them individually to the java build path.
When I manually add a jar file to the lib directory of the Java Project,
the Java Build Path Library entry in the properties view shows the new
jar and I can reference classes inside the jar - no problem.
When my builder adds a jar file to the lib directory of the Java
Project, the Java Build Path Library entry is not updated and the jar
does not show up - so I have compilation problems because the classes
inside that jar are not found. Any user action to the lib dir (like
touching the lib dir or adding anohter jar, etc.) will cause the Java
Build Path Library entry to update and the compilation problems are
resolved.
My guess is that when I add a jar to a Java Project via my Eclipse
Builder, some sort of notification mechanism is being skipped which
would normally cause the Java Project to see the new jar in the lib dir
and add it to the classpath.
Does anyone know how I can manually "kick" the Java Build path to see
the jar I added to the lib dir so it gets added to the classpath?
|
|
|
|
Re: How can I cause a Java Build Path Library to resolve a new Jar added Programatically? [message #243414 is a reply to message #243323] |
Thu, 03 May 2007 12:17  |
Eclipse User |
|
|
|
jkenny wrote:
> My Eclipse plugin has a builder which adds a jar file to a Project with
> the Java Nature. The Java Project has a Java Build Path Library entry
> for a lib folder in the project so that I can add jars to the lib dir
> and not have to manually add them individually to the java build path.
>
> When I manually add a jar file to the lib directory of the Java Project,
> the Java Build Path Library entry in the properties view shows the new
> jar and I can reference classes inside the jar - no problem.
>
> When my builder adds a jar file to the lib directory of the Java
> Project, the Java Build Path Library entry is not updated and the jar
> does not show up - so I have compilation problems because the classes
> inside that jar are not found. Any user action to the lib dir (like
> touching the lib dir or adding anohter jar, etc.) will cause the Java
> Build Path Library entry to update and the compilation problems are
> resolved.
>
> My guess is that when I add a jar to a Java Project via my Eclipse
> Builder, some sort of notification mechanism is being skipped which
> would normally cause the Java Project to see the new jar in the lib dir
> and add it to the classpath.
>
> Does anyone know how I can manually "kick" the Java Build path to see
> the jar I added to the lib dir so it gets added to the classpath?
Since you entered a bug, let's continue the discussion there:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=184965
|
|
|
Powered by
FUDForum. Page generated in 0.06939 seconds