Forum

Home / Forum
You need to log in to create posts and topics.

Java configuration problem when running GUI under Linux

Hello,

I get an error message about JRI Native Library when I run FishResp (even with sudo) . I assume there is some file that needs path info. There are so many variants on this message on the Web and I have tried so many recommendations, that I am lost as to what to do next. It's a Java problem, here is what I have installed and path info:

alyre@alyre-VC66 ~ $ java -version
java version "1.8.0_221"
Java(TM) SE Runtime Environment (build 1.8.0_221-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.221-b11, mixed mode)

$ echo $JAVA_HOME
/usr/share/java/jdk1.8.0_221

added to profile in /etc

export JAVA_HOME=/usr/share/java/jdk1.8.0_221
export PATH=${JAVA_HOME}/bin:${PATH}
export JAVA_HOME
export JRE_HOME
export PATH

Give the error below.

Would be grateful for any help.

 

Alyre

Error message :

Cannot find JRI native library!
Please make sure that the JRI native library is in a directory listed in java.library.path.

java.lang.UnsatisfiedLinkError: no jri in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1122)
at org.rosuda.JRI.Rengine.<clinit>(Rengine.java:19)
at com.fishrespbase.Main.initR(Main.java:306)
at com.fishrespbase.Main.start(Main.java:55)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$8(LauncherImpl.java:863)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$7(PlatformImpl.java:326)
at com.sun.javafx.application.PlatformImpl.lambda$null$5(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$6(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)

 

Hello Alyre,

Thank you for contacting us and mentioning this issue!

I have installed the latest LTS version of Ubuntu (18.04.2) and got exactly the same problem. As the problem comes from Java's side, it is difficult to say what is an exact reason of such error. It seems that JDK8 with 'default' JRI or JDK8 with JavaFX have been incompatible.

Anyway, I created a new script for installing FishResp on Ubuntu 18.04 LTS, where all Java components restricted only to 8th edition (not allowing to install automatically components of Java 9 or 11).

Please, find new instructions here: https://fishresp.org/gui-application/

Best wishes,

Sergey Morozov

Thanks very much for the help. Still no joy. However, there were some errors below during the install, some of them having to do with rjava. Perhaps there might be a clue in the following.  We can always run it under R as an option. Could try an install on an alternative live distribution ?

Cheers

Alyre

rjava.c: In function ‘RJava_request_lock’:
rjava.c:22:3: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
write(ipcout, buf, sizeof(ptrlong));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
rjava.c: In function ‘RJava_clear_lock’:
rjava.c:30:3: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
write(ipcout, buf, sizeof(ptrlong));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
rjava.c: In function ‘RJava_request_callback’:
rjava.c:39:3: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
write(ipcout, buf, sizeof(ptrlong) * 3);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
rjava.c: In function ‘RJava_init_ctrl’:
rjava.c:51:3: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
write(ipcout, buf, sizeof(ptrlong));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
rjava.c:52:3: warning: ignoring return value of ‘read’, declared with attribute warn_unused_result [-Wunused-result]
read(resin, buf, sizeof(ptrlong) * 2);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gcc -std=gnu99 -o libjri.so Rengine.o jri.o Rcallbacks.o Rinit.o globals.o rjava.o -shared -L/usr/share/java/jdk1.8.0_221/jre/lib/amd64/server -ljvm -Wl,--export-dynamic -fopenmp -Wl,-Bsymbolic-functions -Wl,-z,relro -L/usr/lib/R/lib -lR -lpcre -llzma -lbz2 -lz -lrt -ldl -lm -licuuc -licui18n
/usr/bin/javac -target 1.4 -source 1.4 -d . ../package-info.java ../RFactor.java ../REXP.java ../RList.java ../Mutex.java ../RVector.java ../RBool.java ../RConsoleOutputStream.java ../Rengine.java ../RMainLoopCallbacks.java
warning: [options] bootstrap class path not set in conjunction with -source 1.4
warning: [options] source value 1.4 is obsolete and will be removed in a future release
warning: [options] target value 1.4 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
4 warnings
/usr/bin/jar fc JRI.jar org libjri.so
make[2] : on quitte le répertoire « /tmp/RtmppsjH4j/R.INSTALL1708612c9b40/rJava/jri/src »
rm -f libjri.so
cp src/libjri.so libjri.so
/usr/bin/javac -target 1.4 -source 1.4 -classpath src/JRI.jar -d examples examples/rtest.java
warning: [options] bootstrap class path not set in conjunction with -source 1.4
warning: [options] source value 1.4 is obsolete and will be removed in a future release
warning: [options] target value 1.4 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
Note: examples/rtest.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
4 warnings
/usr/bin/javac -target 1.4 -source 1.4 -classpath src/JRI.jar -d examples examples/rtest2.java
warning: [options] bootstrap class path not set in conjunction with -source 1.4
warning: [options] source value 1.4 is obsolete and will be removed in a future release
warning: [options] target value 1.4 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
Note: examples/rtest2.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
4 warnings

New instructions have been tested on two different desktops with Ubuntu 18.04 LTS, but no mistakes were observed. Have you removed all Java and R components including configuration files before making installation with new instructions? Important note: JAVA_HOME, PATH and other Java configurations should not be changed manually for the correct work of FishResp. Changed paths to Java or any Java components which version is not from Java 8 might be a reason for those mistakes. Please, check also how the R package 'rJava' behaves when you loaded it into R.

I still think, some remaining Java component on the current computer conflicts with Java 8 or rJava. What if you install FishResp on a fresh and clean Ubuntu 18.04?

I have also tried to install FishResp on Raspbian Pi 3B+ with just 1GB RAM following the same new instructions and it was successful. The distribution in the latter case is Ubuntu Mate 18.04 LTS. I guess, Linux 64-bit distributions based on Debian should work with FishResp, but we support only Ubuntu distributions now.

Best wishes,

Sergey

Hi again,

Probably messed something up trying to get it to work. I was able to run it successfully from a live session of Ubuntu, so I can confirm that the current procedure does work. I did remove all versions of Java and their associated configuration files. I have a backup of my installation before playing around with the settings so I will probably do a restore and start from there.

 

Thanks for the help - I know a bit more about the quirks and flavors of Java.

 

Alyre

Hello Alyre,

That is a good plan which will lead to a successful installation. Anyway, in case of any problems or questions related to FishResp, please do not hesitate to contact us again here or via email.

Thank you so much for your contribution to the FishResp project!

Sergey