Unable to install R Java on 64 bit windows

Hello everyone, My name is AJ and I need your help,
I had tried to install packages on my R studio but I got an error stating r java not found. I came on here to check if I could find a solution but the response closest to what I was looking for stated that I should download r java first. However, upon copying the command to install r java, I got the error message below,
Error: package or namespace load failed for ‘rJava’:
.onLoad failed in loadNamespace() for 'rJava', details:
call: fun(libname, pkgname)
error: JAVA_HOME cannot be determined from the Registry

kindly advice on what I should do. Thank you!

Do you have a 64 bit version of the Java Development Kit installed in your system? if so, set the JAVA_HOME environment variable in a .Renviron file pointing to the installation path, for example, this is the line I have in my .Renviron file.

JAVA_HOME='C:/Program Files/Java/jdk-11.0.1/'

Thank you for your response.
I recently installed java on my system but how do I set it in a reviron file?

Simply create a file in your HOME directory called .Renviron(it is basically a text file) and add the line specifying the path to your JDK installation.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.