diego gonzalez
diego gonzalez

Reputation: 51

RXTX Java Eclipse on Mac

I have a problem with the RXTX library where I get this message error. I have looked at a lot of websites and forms and tried all of them but there is not an answer to my problem:

java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: dlopen(/Library/Java/Extensions/librxtxSerial.jnilib, 1): no suitable image found.  Did find:
/Library/Java/Extensions/librxtxSerial.jnilib: no matching architecture in universal wrapper thrown while loading gnu.io.RXTXCommDriver
Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: dlopen(/Library/Java/Extensions/librxtxSerial.jnilib, 1): no suitable image found.  Did find:
    /Library/Java/Extensions/librxtxSerial.jnilib: no matching architecture in universal wrapper
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1938)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1858)
    at java.lang.Runtime.loadLibrary0(Runtime.java:870)
    at java.lang.System.loadLibrary(System.java:1122)
    at gnu.io.CommPortIdentifier.<clinit>(CommPortIdentifier.java:83)
    at javaduino.javaduinoframe.inicializarConexion(javaduinoframe.java:96)
    at javaduino.javaduinoframe.<init>(javaduinoframe.java:80)
    at javaduino.javaduinoframe$1.run(javaduinoframe.java:33)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

Upvotes: 1

Views: 3378

Answers (2)

diego gonzalez
diego gonzalez

Reputation: 51

I found the solution to my problem the next day. I posted the question here: Installing RXTX on Mac OS Mountain Lion.

The problem was that the file that goes into the /Library/java/extension directory was not updated. The website URL above has everything you need.

  1. Go to http://rxtx.qbang.org/wiki/index.php/Download and download the binary version 2.1.7.
  2. Unzip the folder and place the unzipped folder on your desktop.
  3. Open the folder and navigate to the Mac_OS_X folder.
  4. Delete the librxtxSerial.jnilib file (I found that this file is using Java 5, and with Mountain Lion I was using Java 6).
  5. Go to Robert Harder’s blog and download his version of the librxtxSerial.jnilib file. Direct link here. Just want to say thank you to Robert for his blog post – it saved me big time. What he has done is compiled a Java 6 friendly version of librxtxSerial.jnilib.
  6. Save this new librxtxSerial.jnilib file in the Mac_OS_X folder of the RXTX folder you have on your desktop from step 2.
  7. Open Terminal and type the following:

    cd /rxtx-2.1-7-bins-r2/

    sudo cp RXTXcomm.jar /Library/Java/Extensions

    sudo cp Mac_OS_X/librxtxSerial.jnilib /Library/Java/Extensions

Upvotes: 4

Ali.Ghodrat
Ali.Ghodrat

Reputation: 3704

STEP BY STEP tutorial. If you follow me from step 1 to step 16, then you will make it, I've used too much screen shots in this tutorial, cause I don't want to leave you in the middle of nowhere! Attention to the bold texts. Good luck!

1- Make sure you have downloaded Java SE.6 from the link below and installed it:

Download Java for OS X 2015-001

2- Create a java project in Eclipse, in the same window select Use a specific JRE then click on configure JREs like picture below:

enter image description here

3- Now select Add

enter image description here

4- Select Standard VM and click next, now click on the Directory in the opened window. Go to the your HDD/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home and click open like picture below:

enter image description here

5- Now you should see JRE system libraries like this:

JRE Libraries

6- Change JRE name to: Java SE.6 (it is not necessary but its better than to give it Home name), now click finish. like picture below:

enter image description here

7- In the new windows select Java SE.6, and click OK, like picture below:

enter image description here

8- Now select Java SE.6 and click finish, like this picture:

enter image description here

9- Create a folder by right click on your project, select new, select folder name it "lib" or whatever you want.

enter image description here

10- Download RXTXcomm.jar from this link: RXTXcomm.jar for Mac then drag and drop it into the folder "lib" which you created it in step 9 and select copy files.

11- Now Right click on the RXTXcomm.jar and select Build Path, then select Add to Build Path.

12- Now right click on your project, then choose Properties, select Java Build Path, click on the Libraries, look at this picture:

enter image description here

Don't give up, you're almost there :)

13- Click on the little arrow of RXTXcomm.jar and expand it, Select Native library location and click on the edit or just double click, like picture below:

enter image description here

14- In the open window, select Workspace and select your project which you've made it for this tutorial and click ok.

15- Now download this file, librxtxSerial.jnilib

16- Copy and paste both RXTXcomm.jar and librxtxSerial.jnilib into this folder: HDD/Library/Java/Extensions (you need to enter your computer password).Look at this picture:

enter image description here

Welldone! You made it :)

Upvotes: 0

Related Questions