library( xlsx) , error: Error occurred during initialization of VM

I'm running into this java error when i try to load a package or library (xlsx);
error i get is:
Error occurred during initialization of VM
Java/lang/NoClassDefFoundError: java/lang/Object

Any help?
I tried most of the google suggested options.
Tried re-installing java/jdk and all and i still get same error.
I'm on RHEL7.9 .


Have you run sudo R CMD javareconf in a system terminal? I might even require a system restart.

Hi Andresrcs -
Yes, we have ran "R CMD javareconf".
We noticed, this issue started happening after OS upgrade. So we tried Downgrading Java , Changed Java path/home to different Java that we have on the server and nothing fixed this.
We found few more packages/libraries with similar issues....


When the developers publish it the get this on Rstudio-connect:

Error occurred during initialization of VM

08/05 07:01:55.684

java/lang/NoClassDefFoundError: java/lang/Object

Error code: render-python-code-error. An error occurred while running Python code.

Possible causes:

  • There is a bug in the Python code being deployed.
  • The Python code depends on conditions that are not present in Connect.
  • The Python code depends on a version of Python that is not configured in Connect.

Possible solutions:

  • Correct bugs in the Python code, then deploy the corrected content.
  • The document rendering log in Connect contains details of the error.
  • For content published from the RStudio IDE, knitting the document in the IDE may also be helpful for debugging.
  • For content published from Jupyter, running the notebook locally may help to isolate the problem.

I see, this is more of an RStudio Connect issue, I'm going to change your topics category to attract attention from RStudio people.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.