R Run Error: Error:package or namespace load failed for ' Rjava ': __java

Source: Internet
Author: User
Tags virtual environment

Problem:

In the process of running R, you will typically need to invoke RJava.dll to run the virtual environment. For example, an error occurred while importing the package library (xlsx):

> Library (xlsx)
Load the required process package: Rjava
Error:package or namespace load failed for ' Rjava ':
Loadnamespace () in the "Rjava" when the onload failed, details:
Call: Indl (x, as.logical (local), as.logical (now), ...)
Error: Unable to load shared object ' D:/program Files (x86)/r/r-3.4.2/library/rjava/libs/x64/rjava.dll ':
LoadLibrary failure: The specified module could not be found.

Error: Unable to load process package ' Rjava '

Workaround:

This situation, is generally installed in the Java environment after the installation of other software to install the Java Class Library rjava.dll,r of the runtime environment can not invoke confirmation. Find your own installed Java environment to configure the RJava.dll in the system environment of R:

>sys.setenv (java_home= ' D:/program Files (x86)/java/jdk1.8.0_144/jre ')

Run the library again (xlsx) and it's OK.

>library (xlsx)
Load the required process package: Rjava
Load the required process package: Xlsxjars

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.