Open cvisintin opened 5 years ago
We could try adding: alternatives --set java /usr/lib/jvm/java-8-openjdk-amd64/jre
I don't think setting of JAVA_HOME is persisting through into the container
This can be solved within an R session by updating the LD_LIBRARY_PATH with Sys.setenv(). This seems less than ideal, but I assume there's a way to add java-8 to the path more generally without breaking anything?
Can the LD_LIBRARY_PATH be set outside of a session? I think that is where we are running into trouble...
It probably can be set globally but possibly shouldn't. Beyond me at this stage, but I'll do some googling.
I would try setting LD_LIBRARY_PATH
a .Rprofile
file in the user's R home directory. The following R code will do that (R's R.home()
function is needed to find the appropriate directory).
rprofile <- file.path(R.home(), ".Rprofile")
file.create(rprofile)
cat('Sys.setenv(LD_LIBRARY_PATH = <blahblahblah>)', file = rprofile)
Maybe it's worth wrapping this and other R things like #3 up in an R setup script to run in the dockerfile?
I this this Rprofile approach means the environment variable is only set for R, not for other programs that might want to use java
I've tried some variants of this, setting LD_LIBRARY_PATH and JAVA_HOME. It seems to break the rJava installation then, so it won't even install RNetLogo.
I'm not sure this is the best route to go down. Why do we need Java 8? I suggest focusing on the NetLogo issue because everything else works: https://github.com/qaecology/boab/issues/4
https://github.com/qaecology/boab/blob/7baf111575d9622d3a35f587b0cc98748b23d7c9/Dockerfile#L51
This is installing multiple versions of JRE - 8 & 11. We need to force only the single version to install or somehow set the version to use to 8