rob42 / freeboard-installer

Installer to aid in freeboard setup tasks.It loads the arduinos, calibrates the IMU, and converts charts.
GNU General Public License v3.0
1 stars 3 forks source link

JNA error on startup #1

Closed raudabaugh closed 10 years ago

raudabaugh commented 10 years ago

Running the jar file on Ubuntu, Java 1.6.0_27, and JNA 3.2.7 results in the following error:

Exception in thread "AWT-EventQueue-2" java.lang.UnsatisfiedLinkError: Can't obtain updateLastError method for class com.sun.jna.Native at com.sun.jna.Native.initIDs(Native Method) at com.sun.jna.Native.(Native.java:136) at com.sun.jna.NativeLong.(NativeLong.java:23) at jtermios.linux.JTermiosImpl.(JTermiosImpl.java:71) at jtermios.JTermios.(JTermios.java:288) at purejavacomm.CommPortIdentifier$1.(CommPortIdentifier.java:189) at purejavacomm.CommPortIdentifier.getPortIdentifiers(CommPortIdentifier.java:182) at nz.co.fortytwo.freeboard.installer.InstalManager.(InstalManager.java:91) at nz.co.fortytwo.freeboard.installer.InstalManager$6.run(InstalManager.java:363) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:226) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:673) at java.awt.EventQueue.access$300(EventQueue.java:96) at java.awt.EventQueue$2.run(EventQueue.java:634) at java.awt.EventQueue$2.run(EventQueue.java:632) at java.security.AccessController.doPrivileged(Native Method) at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:108) at java.awt.EventQueue.dispatchEvent(EventQueue.java:643) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:275) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:200) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:185) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:177) at java.awt.EventDispatchThread.run(EventDispatchThread.java:138)

No error when passing "-Djna.nosys=true" to the JVM. I think the issue may be caused by the version of JNA in the Ubuntu repos being outdated. Any insights would be appreciated.

rob42 commented 10 years ago

Ive been using Kubuntu 13.04 (also 12.10), Java 1.7.0_07 and no problems. I have libjna 3.2.7 installed, but I dont think I'm using it, there is also one in the JNA jar. The project was compiled on 1.7, so that may have an effect.

I didnt install java from the repository - just using the download from Oracle. Its in /home/robert/java/jdk1.7.0_07/bin, which I added to my path so I can just use 'java'

Sounds like a similar problem to this https://netbeans.org/bugzilla/show_bug.cgi?id=211655.

Can you try with jdk1.7 pls, and also can you confirm if the functionality is normal when using "-Djna.nosys=true", especially the uploading of hex files.

Thnx Rob

raudabaugh commented 10 years ago

Yes, using Java 1.7.0_51 and the problem is gone. Also, uploading the hex file worked when using "-Djna.nosys=true".

rob42 commented 10 years ago

OK, the solution is jdk1.7+, and the 1.6 workaround is as you have described above, so I will close this issue now