I want to call a method in jar from another eclipse plugin project that has dependent to the project. But eclipse can't resolve the classname in jar.
Example:
I created com.plugin.main
and com.plugin.sub
project.
- Added poi-ooxml-xxx.jar into
com.plugin.sub
project and added the buildpath through preference dialog. - Added all packages in jar as exported packages to MANIFEST.MF in
com.plugin.sub project
. - Added
com.plugin.sub
as required plugin to MANIFEST.MF in com.plugin.main project.
But eclipse can't resolve the classname in jar WorkbookFactory
from com.plugin.main.actions.SampleAction. Why?
Information:
- eclipse 3.6(Helios)
- JavaSE-1.7.
WorkbookFactory
's FQCN isorg.apache.poi.ss.user.model.WorkbookFactory
.
MANIFEST.MF in com.plugin.main
:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Main
Bundle-SymbolicName: com.plugin.main; singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: com.plugin.main.Activator
Bundle-Vendor: PLUGIN
Require-Bundle: com.plugin.sub;visibility:=reexport,
org.eclipse.ui,
org.eclipse.core.runtime
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ActivationPolicy: lazy
MANIFEST.MF in com.plugin.sub
:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Sub
Bundle-SymbolicName: com.plugin.sub
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: com.plugin.sub.Activator
Bundle-Vendor: PLUGIN
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ActivationPolicy: lazy
Export-Package: org.apache.poi.ss.usermodel
Bundle-ClassPath: poi-ooxml-3.8-beta3-20110606.jar,
.
build.properties in com.plugin.sub
:
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
poi-ooxml-3.8-beta3-20110606.jar