I have several java version installed in my linux server, in
/usr/local/java/jdk1.8.0_131 (this is the correct version)
/usr/local/java/jdk1.7.0_79
/usr/local/java/jdk1.8.0_171
I am using sparklyr
package to connect to spark cluster, but when I start rstudio and use sparklyr to get connect, it fails and tell me the java version is not correct.And after I use Sys.setenv(JAVA_HOME = '/usr/local/java/jdk1.8.0_131')
, everything works fine.
But the weird thing is I have already set JAVA_HOME = /usr/local/java/jdk1.8.0_131
in my /etc/profile
(else I will fail even I try to start spark in bash)
So here the question is, when we start rstudio in linux, where by default it will locate as its default java execution location? And how could we change it(I don’t want to change it everytime I start a new r session)
FYI:when I use alternatives –display java, it gives me the jdk1.7.0_79 version, which is the wrong version and I think may be R session is also using this version. But it is a guess and not confirmed.