Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix rJava install error configure: error: Java interpreter '/usr/bin/java' does not work

Tags:

r

rjava

I am trying to install package "xlsx" in RStudio on a mac. It tries to install rJava and I get the following error:

checking whether Java run-time works... No Java runtime present, requesting install.

no configure: error: Java interpreter '/usr/bin/java' does not work ERROR: configuration failed for package ‘rJava’ * removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/rJava’ * restoring previous ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/rJava’ Warning in install.packages : installation of package ‘rJava’ had non-zero exit status

It prompts me to go download Java and I do. Once it is done installing I try to install package rJava again in RStudio and it give me the exact same error and prompts me to download Java again.

I can see Java in my system preferences but when I go to the terminal and type java -version I get the same prompt to go download Java. It's like my computer just isn't recognizing Java.

Any idea for how I can fix this and get rJava installed?

Thank you!

like image 854
ARobl Avatar asked Oct 26 '25 09:10

ARobl


1 Answers

I was having the same issue at linux... From "/usr/bin/java" you are using Linux, presume this is also the case. The required Java installer can be installed as described here in linux terminal

sudo apt-get install default-jre
sudo apt-get install default-jdk

by restarting R installation worked

like image 63
hamagust Avatar answered Oct 28 '25 22:10

hamagust



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!