Код: Выделить всё
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: library Plug-in
Bundle-Version: 2.0.7
Bundle-Activator: library.util.Activator
Import-Package:
com.sun.jna;version="5.10.0",
com.sun.jna.platform;version="5.10.0",
org.osgi.framework;version="1.4.0"
Export-Package:
library.printing,
library.security.auth,
library.util,
library.util.coordinate,
library.util.debug,
library.xml
Bundle-SymbolicName: library
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Код: Выделить всё
package library.printing;
import com.sun.jna.Library;
import com.sun.jna.Native;
public interface PrinterTypeDetectionInterface extends Library {
PrinterTypeDetectionInterface INSTANCE = Native.load("C:\\java\\DLL\\printerTypeV2-4", PrinterTypeDetectionInterface.class);
int getPrinterType(String printerName);
void cleanup();
}
Проверка Были обнаружены следующие проблемы
- библиотека
Отсутствует ограничение: Import-Package: com.sun.jna; version="5.10.0" - Отсутствует ограничение: Import-Package: com.sun.jna.platform; version="5.10.0"
а это файл манифеста основного проекта:
Код: Выделить всё
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: reform.about
Bundle-SymbolicName: reform.about
Bundle-Version: 3.0.6
Bundle-ClassPath: .,
lib/fitnesse.jar,
lib/castor-1.0.jar,
lib/commons-logging-1.0.3.jar,
lib/jta1.0.1.jar,
lib/xerces-2.6.0.jar,
src/test/junit.jar
Bundle-Activator: com.aselsan.rehis.reform.library.about.OSGi.AboutBundle
Import-Package:
com.aselsan.mst.library.security.auth,
com.aselsan.mst.library.ui.baslikPanel,
com.aselsan.mst.library.xml,
com.aselsan.rehis.reform.lookandfeel.reformUI,
com.aselsan.rehis.reform.ortakYapilandirma.tema.temaInterface,
com.aselsan.rehis.reform.ortakYapilandirma.temaObserver,
com.aselsan.rehis.reform.ortakYapilandirma.yapilandirmaSunucu.yapilandirmaSunucuInterface,
com.aselsan.rehis.reform.dosYA,
com.aselsan.rehis.reform.dosYA.factory,
com.aselsan.rehis.reform.dosYA.sunum.gezinti,
com.aselsan.rehis.reform.dosYAInterface,
com.jgoodies.looks,
com.jgoodies.looks.plastic,
javax.swing,
javax.swing.table,
org.osgi.framework,
org.osgi.util.tracker,
com.aselsan.mst.library.printing
Export-Package: com.aselsan.rehis.reform.library.about
Мой проект использует OSGi, и я также добавил jna в конфигурации запуска.
итак, проблема в использовании JNA с OSGi
Подробнее здесь: https://stackoverflow.com/questions/787 ... aint-error