NeuronRobotics / nrjavaserial

A Java Serial Port system. This is a fork of the RXTX project that uses in jar loading of the native code.
Other
345 stars 143 forks source link

java.lang.NoSuchFieldError: SIZE thrown while loading gnu.io.RXTXCommDriver #120

Closed Wuifal closed 4 years ago

Wuifal commented 6 years ago

Hey guys,

I'm using nrjavaserial with netbeans and everything works fine, as long I start my code from netbeans. I've tested two ways for the natives directory 1: I've added it to the classes directory and 2: just added it as source. Both works like a charm.

But when I load the jar with java.exe, I receive the exception above. Advapi32Util.registryGetValues is throwing it.

PeteSL commented 5 years ago

This is caused by an incompatibility between the jna.jar and the jna-platform.jar you are using. The JNA folks removed Pointer.SIZE in JNA 5.0 (current is 5.1) and replaced it with Native.POINTER_SIZE for commonality of classes in JNA. That said, since NRJavaSerial uses jna-platform for its Windows support, be sure your jna.jar and jna-properties.jar are the same version.

madhephaestus commented 4 years ago

OS/Java configuration, no change in library, closing