A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://kb.databricks.com/r/install-rjava-rjdbc-libraries.html below:

Install rJava and RJDBC libraries

This article explains how to install rJava and RJBDC libraries.

Problem

When you install rJava and RJDBC libraries with the following command in a notebook cell:

%r

install.packages(c("rJava", "RJDBC"))

You observe the following error:

ERROR: configuration failed for package 'rJava'
Cause

The rJava and RJDBC packages check for Java dependencies and file paths that are not present in the Databricks R directory.

Solution

Follow the steps below to install these libraries on running clusters.

  1. Run following commands in a %shcell.
    %sh
    
    ls -l /usr/bin/java
    ls -l /etc/alternatives/java
    ln -s /usr/lib/jvm/java-8-openjdk-amd64 /usr/lib/jvm/default-java
    R CMD javareconf
  2. Install the rJava and RJDBC packages.
    %r
    
    install.packages(c("rJava", "RJDBC"))
  3. Verify that the rJava package is installed.
    %r
    
    dyn.load('/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server/libjvm.so')
    library(rJava)

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4