2

I am trying to install rJava to conduct MaxEnt (Dismo package) on the servers of a super computer that run Linux. All the other packages have been successful, but rJava continues to give errors.

I have followed the answers from this thread including adding jre to my file path, using R CMD javareconf, and installing a new JDK and specifying that as the $JAVA_HOME. Unfortunately, I cannot use the apt-get function because of my role on the servers, although I believe this would be the best solution since it will correct my necessary file paths. However, perhaps I am missing something else that is causing the error.

This is the Java Version I am using: - openjdk version "1.8.0_181" - OpenJDK Runtime Environment (build 1.8.0_181-b13) - OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode)

This is the error msg that is produced

checking whether ~/Core/java/1.8.0_121/bin/javah actually works... no
checking whether javah was replaced by javac -h... no
configure: error: one or more Java tools are missing.

*** JDK is incomplete! Please make sure you have a complete JDK. JRE is *not* sufficient.
configure: error: ./configure failed for jri
ERROR: configuration failed for package 'rJava'
* removing '/home/afila/R/x86_64-pc-linux-gnu-library/3.5/rJava'

The downloaded source packages are in
        '/tmp/RtmpvYtNJY/downloaded_packages'
AFilazzola
  • 23
  • 2
  • Can you try to run `javac` once? Maybe your path isn't configured correctly (JAVA_HOME by itself isn't really useful) – DownloadPizza Oct 14 '19 at 14:14
  • @Gabgab2003 Good point. I have tried to correct the path too using `export PATH=$PATH:$JAVA_HOME/bin` but not working still – AFilazzola Oct 15 '19 at 00:51
  • Can you prepend java_home to the path? Like `export PATH="$JAVA_HOME:$PATH" ` also, I assume you know this but just to be sure: the env variables are only changed for the current terminal – DownloadPizza Oct 15 '19 at 03:58
  • @Gabgab2003 No luck. However, looking through it more I am pretty sure the error is caused by R not pulling the correct filepath for java. I also didn't noticed this earlier but R CMD javareconf produces an error `cannot create ~/R/etc/Makeconf.new` – AFilazzola Oct 15 '19 at 15:34
  • I think this goes back to how I cannot work out of root because of privileges – AFilazzola Oct 15 '19 at 15:36

1 Answers1

0

The issue I was having was indeed a permissions problem. Someone helped me resolve it by emulating the root system using proot. After that it was a matter of re-configuring the directory and R's access to it.

In Unix

mkdir ~/etc cp -a $EBROOTR/lib64/R/etc/* ~/etc proot -b R CMD javareconf -e

In R

install.packages("rJava") library(rJava)

AFilazzola
  • 23
  • 2