Eralt / arduino

Automatically exported from code.google.com/p/arduino
0 stars 0 forks source link

Add /usr/lib/jni to LD_LIBRARY_PATH in call to Java on Linux. #385

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
From Scott Howard:

the patch to ubuntu is to use the -D command in the wrapper so it will
work for both sun-java and openjdk:

java -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel
-DLD_LIBRARY_PATH=/usr/lib/jni/ -jar /usr/share/arduino/arduino.jar

Also:

The work around is to set the LD_LIBRARY_PATH, you can put the
following in your .bashrc file

for JNI_PATH in /usr/lib/jni /usr/share/jni
do
 if [ -d "$JNI_PATH" ]
 then
   if [ -z "$LD_LIBRARY_PATH" ]
   then
     export LD_LIBRARY_PATH="$JNI_PATH"
   else
     export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$JNI_PATH"
   fi
done

Original issue reported on code.google.com by dmel...@gmail.com on 21 Oct 2010 at 12:40

GoogleCodeExporter commented 9 years ago
Hi David, an even simpler solution is:

LD_LIBRARY_PATH="/usr/lib/jni${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
export LD_LIBRARY_PATH

thanks.

Original comment by showard...@gmail.com on 12 Nov 2010 at 2:47

GoogleCodeExporter commented 9 years ago
On further investigation, I'm confused as to why I need to even add 
/usr/lib/jni.  On my machine (Ubuntu 10.04), RXTX (2.1.7r2-4ubuntu1) goes into 
/usr/lib (.so) and /usr/share/java (.jar).  I'm closing this as a duplicate of 
issue 14.  Patches welcome there that will get Arduino working properly with 
the distribution's RXTX.

Original comment by dmel...@gmail.com on 27 Nov 2010 at 11:00