Setup Java with R
To prevent future problems when using Java, you need to install Java to your machine correctly.
- Download the correct version of Java from https://www.java.com/en/download/manual.jsp
- Right-click the Java setup app to “Run as Admin”
- After installing Java, go to R and let your machine know the right path to Java (Make sure you run R as Admin as well).
Sys.setenv(JAVA_HOME='C:\\Program Files\\Java\\jre1.8.0_311') # for 64-bit version
Sys.setenv(JAVA_HOME="C:\\Program Files (x86)\\Java\\jre1.8.0_311") # for 32-bit version