Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to load an eclipse plug-in

Tags:

java

eclipse

I have recently developed an Eclipse plugin, however the plugin does not seem to load in Eclipse (3.4.2). If I go to

Help > About Eclipse Platform > Configuration Details

I see the pluging listed

file:/C:/Program Files/eclipse/ganymede/plugins/de.vogella.plugin.htmlconverter_1.0.0.jar

However it does not seem to work. I know the plugin has been implemented correctly as if I right click on the project (de.vogella.plugin.htmlconverter) and select Run Eclipse Application then a new Eclipse is launched and the popup menu that has been implemented works. So why does it not work when I export the project from Eclipse and place it in the plugins directory.

I have tried this on both Windows XP and Mac OS X to no avail, if I inspect the JAR I see all the required artifacts.

META-INF/
META-INF/MANIFEST.MF
de/
de/vogella/
de/vogella/plugin/
de/vogella/plugin/htmlconverter/
de/vogella/plugin/htmlconverter/handler/
src/
src/de/
src/de/vogella/
src/de/vogella/plugin/
src/de/vogella/plugin/htmlconverter/
src/de/vogella/plugin/htmlconverter/handler/
de/vogella/plugin/htmlconverter/Activator.class
de/vogella/plugin/htmlconverter/handler/Convert.class
plugin.xml

My MANIFEST.MF also looks like this

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Htmlconverter Plug-in
Bundle-SymbolicName: de.vogella.plugin.htmlconverter;singleton:=true
Bundle-Version: 1.0.0
Bundle-Activator: de.vogella.plugin.htmlconverter.Activator
Require-Bundle: org.eclipse.ui,org.eclipse.core.runtime,org.eclipse.co
 re.resources;bundle-version="3.4.0",org.eclipse.jdt.core;bundle-versi
 on="3.4.0"
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Import-Package: org.osgi.framework;version="1.3.0"
Export-Package: de.vogella.plugin.htmlconverter;uses:="org.osgi.framew
 ork,org.eclipse.ui.plugin",de.vogella.plugin.htmlconverter.handler;us
 es:="org.eclipse.core.commands,org.eclipse.core.resources,org.eclipse
 .core.runtime"

I have tried lazy activation and eager activation, but still nothing. Whats really confusing is that it works when I debug and launch a separate Eclipse application. Any ideas what I am doing wrong.
Are there other Eclipse plugins out there that can perform some form of diagnostics and tell me what is wrong.

Final point, if I look at the Eclipse error log I see no errors. However, if I edit the MANIFEST.MF and put in some rubbish strings, it reports and error validating the MANIFEST.MF so I know Eclipse sees the plugin

Can anyone help?

like image 550
ng. Avatar asked Sep 04 '26 02:09

ng.


1 Answers

Sounds like you are using my tutorial: http://www.vogella.de/articles/EclipsePlugIn/article.html

The installation medium p2 has been enhanced between 3.4 and 3.5. This may explain the difference in the behavior. It sounds like you have the option to use Eclipse 3.5. I strongly recommend to use 3.5 as p2 in 3.4 was the very first version of p2 which replaced the old update manager.

like image 75
Lars Vogel Avatar answered Sep 05 '26 16:09

Lars Vogel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!