Openjdk - libnio

Hi, I am trying to run an R script that uses a java program, it makes use of java jdk 11. I have installed both openjdk and java oracle, set my default interpeter to java 11, succesfully ran sudo R CMD javareconf, but when I try to make use of the function I get the following error:

java.lang.UnsatisfiedLinkError: /usr/lib/jvm/java-11-openjdk/lib/libnio.so: /usr/lib/jvm/java-11-openjdk/lib/libnio.so: undefined symbol: reuseport_available

Do you have any suggestions?

Try env LD_LIBRARY_PATH=/usr/lib/jvm/java-11-openjdk/lib before your script. I get that error regularly when trying to run .jar files, and this fixes it for me.

Thanks for the suggestion. When I run my script from the console I get no errors, but when I run in from Rstudio the error remains. I tried setting a variable within Rstudio environment but I’m getting the same error. Do you have any other suggestion?

It might be worth looking through information on javareconf. Based on this, you could try messing with some of your environment variables before running it, such as JAVA or JAVA_LD_LIBRARY_PATH.