qaecology / boab

Files for administering Boab server
0 stars 0 forks source link

Java woes... #1

Open cvisintin opened 5 years ago

cvisintin commented 5 years ago

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

cvisintin commented 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

jdyen commented 5 years ago

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?

cvisintin commented 5 years ago

Can the LD_LIBRARY_PATH be set outside of a session? I think that is where we are running into trouble...

jdyen commented 5 years ago

It probably can be set globally but possibly shouldn't. Beyond me at this stage, but I'll do some googling.

goldingn commented 5 years ago

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?

goldingn commented 5 years ago

I this this Rprofile approach means the environment variable is only set for R, not for other programs that might want to use java

jdyen commented 5 years ago

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.

jdyen commented 5 years ago

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