How to import COM4j as Eclipse Plugin?

534 Views Asked by At

I am following the guide shown in https://molteni.wordpress.com/2012/10/16/connect-hp-quality-center-with-java-using-com4j-tutorial/ to generate resources of COM4J.

This is how the COM4J folder looks like

enter image description here

I tried to create an Eclipse plugin based on it and show as below

enter image description here

However when I added the plugin as one of the dependencies of my application I am unable to import the file.

I get the following error when I tried to search it through "Open Type" in Eclipse as follow

enter image description here

What steps am I missing here ?

2

There are 2 best solutions below

0
Alex K. On

Usually it is done like this: in Eclipse go to File -> New -> Plugin Development -> Plugin From Existing Jar Files

enter image description here

Though it might not help in this case: please see this issue: https://java.net/jira/browse/COM4J-57

2
greg-449 On

It sounds like you have not specified which classes are exported by the plugin.

Open the MANIFEST.MF editor for the plugin and select the Runtime tab. In the 'Exported Packages' section click Add and select all the packages which should be available to other plugins.