Plug-in method call in Eclipse

I've created two plug-ins.

Extension point (Plugin 1):

edu.xyz.harsha.tetris

Extension (Plugin 2):

edu.xyz.harsha.tetrisext

plugin1 has Tetris class which calls Clock class. I defined Clock class in plugin2. Now I want to use Clock class in plugin1. How can I use methods of Clock class from plugin2 in Tetris class of plugin1?

Thanks in advance.

Upvotes: 0

Views: 80

Answers (1)

greg-449
greg-449

Reputation: 111216

In the MANIFEST.MF editor for plugin2 add the package which contains your Clock class to the 'Exported Packages' section of the 'Runtime' tab. This will add a 'Export-Package' entry to the MANIFEST.MF.

In the MANIFEST.MF editor for plugin1 add plugin2 to the 'Required Plug-ins' section of the 'Dependencies' tab. This will add a 'Require-Bundle' entry to the MANIFEST.MF

You should now be able to import 'Clock' in the normal way in your Java code.

Upvotes: 1

Related Questions