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!