The issue is as follows:
-
I have a 3rd party Eclipse plug-in installed and running
-
The above Eclipse plug-in provides an “extension point” of sorts – a source for a class I can extend/rewrite and replace in the plug-in lib directory (I am not saying it’s a great idea, but necessity makes us do things we are not proud of – in-house development has its quirks)
-
The idea here is to envelop any such change in an external JAR (created by us) so that any change in code wouldn’t require us to restart Eclipse to “refresh” the “extension point” class during development.
-
Eventually, a plugin/bundle will be created and placed as a dependency on the original plugin – so that installing and using that plug-in would actually, you know, work.
Question is – can I somehow add what is basically an external JAR file to Eclipse Application debug/run configuration?
Normally, adding JAR to classpath tab would work for regular Java application debugging/running. Eclipse Application however, doesn’t have that tab.
So far the efforts (failed, perhaps due to some stupid syntax error or whatnot) included:
- Adding the JAR as a dependency to
Bundle-ClassPath:of the plug-in asC:\test.jar - Adding the JAR to the system’s CLASSPATH variable
None of that made any difference – the code in the “extension point” that refers to a class in the JAR file fails – exception that boils down to:
Caused by: java.lang.ClassNotFoundException: test.Test
at org.eclipse.osgi.internal.loader.BundleLoader.
findClassInternal(BundleLoader.java:506)
Any pointer/help/criticism would be greatly appreciated.
Update
Apparently putting the JAR in the lib directory of the plug-in and updating the MANIFEST file doesn’t work (not that it would help me – since such a solution would require a “refresh”, which I am trying to avoid in the first place), so I must be doing something fundamentally wrong.
Does that make any sense or did I miss something in one of those attempts?
I have included an external JAR file to my Eclipse application…..not to the debug/run configurations but to the application itself.
What we did was to wrap the plugin into it’s own java project. We are using maven for our build, so the pom.xml lists the dependency as the .jar file (which we put into a lib directory in the project). The manifest.mf file exports the needed classes. My application plugins have a dependency on this project. When I debug/run the application in the workbench I just make sure that this library project is included.
I’m not sure this answers your question completely or not….but I hope it helps.