Sign in with Microsoft
Sign in or create an account.
Hello,
Select a different account.
You have multiple accounts
Choose the account you want to sign in with.

Problem

When you try to load the 'rJava' package you get the error:

Error: .onLoad failed in loadNamespace() for 'rJava'

Solution

Their are a number of environment variables and paths that need to be set on your system, in order for the 'rJava' package
to load successfully.

You should check the following on Windows:

  • Make sure that the environment variable 'JAVA_HOME' is set properly and points to a 64-bit version jof Java(JDK or SE
          Runtime). For 64-bit Revolution R you need to make sure that you have a 64-bit version of Java installed.

  • Make sure that the Java 'CLASSPATH' variable is set properly.
          For the 64-bit version of the JDK, this is typically set to something like the following(on Windows):
          'C:\Program Files\Java\jdk1.7.0_02\jre\lib\ext'

  • Check your system PATH settings. On Windows, goto 'Control Panel ---> System --> Advanced Settings ---> Environment Variables'.
          Your path should include the directories:   'C:\Program Files\Java\jre6\bin\server' and 'C:\Revolution\R-Enterprise-7.3\R-3.1.1\bin\x64'.

  • Make sure that the environment variables 'RPATH' and 'RHOME' are BOTH set and point to the directory:
          'C:\Revolution\R-Enterprise-7.3\R-3.1.1\bin\x64'

The same settings are required on Linux, however the paths will be different:

  • CLASSPATH:  /usr/java/jdk1.7.0_02/jre/lib/ext

  • RPATH and RHOME:  /usr/lib64/Revo-7.3/R-3.1.1

On Linux, it is also recommended that you run the command :

R CMD javareconf

This will attempt to configure Java properly on your system for use with Revolution R Enterprise.

Note that if not ALL of the configuration settings are filled out after running 'R CMD javareconf', this usually means that rJava won't work and your Java installation/configuration is insufficient.

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.

Was this information helpful?

What affected your experience?
By pressing submit, your feedback will be used to improve Microsoft products and services. Your IT admin will be able to collect this data. Privacy Statement.

Thank you for your feedback!

×