First, install JAVA (follow the instructions provided in the link) and then install R and RStudio.

After setting up JAVA_HOME, open RStudio.

1. Install rJava from the packages window or run the following command:


2. Run this command in the RStudio Terminal to reconfigure Java:

sudo $(which R) CMD javareconf

Restart RStudio after running the command.

3. Install the xlsx package using:


Restart RStudio again.

Note: Ensure you restart RStudio after each installation to avoid errors.


Install rJava and xlsx in RStudio on Ubuntu Linux

Leave a Reply