0

I am using rJava package in R on MacOS. This error happened:

Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl,  : 
java.lang.OutOfMemoryError: Java heap space

I need rJava to open an Excel file with xlsx package. With this error I can not read the .xlsx files. I wonder how to solve this problem?

Hans Wang
  • 25
  • 3

1 Answers1

0

You need to modify the java parameters with the following function at the start of your script.

options(java.parameters = "-Xmx8000m")

You may also need restart your environment first.

Foxhound
  • 585
  • 5
  • 16