Giter Club home page Giter Club logo

Comments (5)

bjeanes avatar bjeanes commented on August 20, 2024

I also tried installing a different version of OpenJDK from the link in the README and had the same output there:

/Library/Java/JavaVirtualMachines/openjdk.jdk/Contents/Home/bin/java -jar ~/Downloads/ModbusMechanic/ModbusMechanic.jar
Exception in thread "main" java.lang.UnsatisfiedLinkError: Can't load library: /var/folders/tb/dc9bcxw57mlf9_5s6ffd1kx80000gn/T/jna--87988168/jna2915415394505014223.tmp
	at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2398)
	at java.base/java.lang.Runtime.load0(Runtime.java:785)
	at java.base/java.lang.System.load(System.java:1979)
	at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:761)
	at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:736)
	at com.sun.jna.Native.<clinit>(Native.java:131)
	at jtermios.macosx.JTermiosImpl.<clinit>(JTermiosImpl.java:55)
	at jtermios.JTermios.<clinit>(JTermios.java:317)
	at purejavacomm.CommPortIdentifier$1.<init>(CommPortIdentifier.java:200)
	at purejavacomm.CommPortIdentifier.getPortIdentifiers(CommPortIdentifier.java:193)
	at com.intelligt.modbus.jlibmodbus.serial.SerialPortFactoryPJC.getPortIdentifiersImpl(SerialPortFactoryPJC.java:45)
	at com.intelligt.modbus.jlibmodbus.serial.SerialPortAbstractFactory.getPortIdentifiers(SerialPortAbstractFactory.java:55)
	at com.intelligt.modbus.jlibmodbus.serial.SerialUtils.getPortIdentifiers(SerialUtils.java:67)
	at modbusmechanic.ModbusMechanic.getPortNames(ModbusMechanic.java:131)
	at modbusmechanic.PacketFrame.getPortNames(PacketFrame.java:1662)
	at modbusmechanic.PacketFrame.initComponents(PacketFrame.java:239)
	at modbusmechanic.PacketFrame.<init>(PacketFrame.java:74)
	at modbusmechanic.ModbusMechanic.main(ModbusMechanic.java:114)

from modbusmechanic.

SciFiDryer avatar SciFiDryer commented on August 20, 2024

Hi,

Thanks for reporting the issue. I did some research and this appears to be related to that JNA version not supporting the Apple Silicon architecture. I'll update JNA to a newer version which should resolve the error in the next release. If you want to update it on your own as a provisional workaround, just replace the JNA bundle with 5.7.0 or newer and update the manifest.txt to include the library's path. I only have access to x86 Apple hardware, so I cannot test.

from modbusmechanic.

bjeanes avatar bjeanes commented on August 20, 2024

Unfortunately it may not be that simple. I am guessing that JNA might have some breaking API changes, because it changes the error to:

java -jar /Applications/ModbusMechanic/ModbusMechanic.jar
Exception in thread "main" java.lang.NoSuchMethodError: 'void com.sun.jna.Native.setPreserveLastError(boolean)'
	at jtermios.macosx.JTermiosImpl.<clinit>(JTermiosImpl.java:55)
	at jtermios.JTermios.<clinit>(JTermios.java:317)
	at purejavacomm.CommPortIdentifier$1.<init>(CommPortIdentifier.java:200)
	at purejavacomm.CommPortIdentifier.getPortIdentifiers(CommPortIdentifier.java:193)
	at com.intelligt.modbus.jlibmodbus.serial.SerialPortFactoryPJC.getPortIdentifiersImpl(SerialPortFactoryPJC.java:45)
	at com.intelligt.modbus.jlibmodbus.serial.SerialPortAbstractFactory.getPortIdentifiers(SerialPortAbstractFactory.java:55)
	at com.intelligt.modbus.jlibmodbus.serial.SerialUtils.getPortIdentifiers(SerialUtils.java:67)
	at modbusmechanic.ModbusMechanic.getPortNames(ModbusMechanic.java:131)
	at modbusmechanic.PacketFrame.getPortNames(PacketFrame.java:1662)
	at modbusmechanic.PacketFrame.initComponents(PacketFrame.java:239)
	at modbusmechanic.PacketFrame.<init>(PacketFrame.java:74)
	at modbusmechanic.ModbusMechanic.main(ModbusMechanic.java:114)

from modbusmechanic.

SciFiDryer avatar SciFiDryer commented on August 20, 2024

I was able to reproduce that exact error in 2.2 after replacing the JNA library. I updated the upstream serial library for the new API bindings and I no longer got errors with the newer JNA in v2.2.1 which is now posted. Now that it launches, 2.2.1 should support your M1 arch. Let me know if you still get errors.

from modbusmechanic.

bjeanes avatar bjeanes commented on August 20, 2024

Yes! It works, thank you :)

from modbusmechanic.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.