Frage

Die ersten Schwierigkeit, JNA mit J9 zu verwenden, ist, dass der J9-JVM das Java.awt-Paket nicht enthält und die native Klasse ein paar Klassen aus diesem Paket importiert.Dies ist leicht zu überwinden, indem Sie die JNA-Quelle herunterladen, um diese Importe und ihre abhängigen Methoden herauszurichten (die ich sowieso nicht benutze) und ein neues JNA-Glas aufbauen.

Hier ist ein einfaches Testprogramm: generasacodicetagpre.

Nachdem ich das Problem von Java.awt korrigiert habe, erhalte ich den Fehler: generasacodicetagpre.

Was bedeutet es mit "inkompatibler JNI-Version"?Hat jemand da draußen, hat j9, um mit jna nett zu spielen?

Update: Ich denke, JNA unterdrückt, dass JNA den folgenden noclassdeffoundError unterdrückt, um die Java.nio.buffer-Klasse zu laden, da J9 anscheinend nicht das NIO-Paket enthält: generasacodicetagpre.

War es hilfreich?

Lösung

I have been working with JNA on j9 for a couple of months now. I have had a few small niggles here and there but things mostly seem working fine.

First - The latest versions of JNA(3.2.7) seem to import awt. I am using 3.2.4 and the awt imports are commented out. I think that will work out of the box for you.

Second - THe version of J9 i am working with is for WinCE and it is a JVM for java 1.4. Latest JNA though is built off of java 1.5. So you might want to check which version of java your version of j9 is built on. JNA 3.2.4 is compatible with java 1.4 I believe.

Andere Tipps

You can also simply provide your own stub implementations of the java.nio/java.awt stuff and simply avoid using those features (mainly direct buffer stuff and obtaining a handle to a native window).

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top