Andrea Cristiano
Andrea Cristiano

Reputation: 21

Fatal error: unable to initialize JIT - R 3.5.1 and RStudio 1.4463

I recently decided to upgrade both R and RStudio on my PC, 64-bit version. First, I uninstalled the previous versions, RStudio 1.4462 and R 3.4.4, and then I installed R 3.5.1 and RStudio 1.4463, in the order here mentioned. The installation goes just fine, but when I try to open R from the desktop shortcut I receive an error message saying:

Fatal error - unable to initialize JIT

The same thing happens with RStudio. I click OK on the message (it's the only thing I can do) and R closes immediately, same for RStudio.

What could cause this issue? I looked around the internet but I couldn't find anything useful.

Upvotes: 2

Views: 5952

Answers (3)

magiclantern
magiclantern

Reputation: 140

I was getting this same error (though on version 2023.12.1+402 of RStudio Desktop and R 4.3.3) on Ubuntu 20.04 / Focal , so confirm this issue still happens in 2024.

Part of the confusion seems to be that this issue can have multiple causes, but due to poor error messaging, finding the necessary actual solution can be difficult.

In my case I was attempting to use a different R from my system R. Turns out that the source of the problem was that RStudio was trying to use the R version in my path, but not using the shared libraries associated with the non-system R version.

I'm using conda to manage my non-system R, but this should work for other methods of installing multiple R versions.

Steps when using bash:

conda activate myrenv
export ORIG_LD_LIBRARY_PATH=$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=${CONDA_PREFIX}/lib/R/lib:${CONDA_PREFIX}/lib:$LD_LIBRARY_PATH
rstudio

When done, you'll need to do this to set your LD_LIBRARY_PATH back to what it was before starting

conda deactivate
export LD_LIBRARY_PATH:$ORIG_LD_LIBRARY_PATH

Upvotes: 0

wolfgang
wolfgang

Reputation: 31

I faced a similar issue. I tried launching rstudio ("Desert Sunflower" Release for RHEL 8) with a different version of R (v4.0.0) than I normally do (v4.3.1) from a conda environment and got the same JIT error as you. I tried a bunch of different solutions (most forums online suggested resetting Rstudio's state) and none of them worked. Then it occurred to me that the version of R and Rstudio I was using may have been incompatible with one another. I tried a conda environment with a different version of R (v4.2.0) and it worked! I hope this helps you or someone else like me facing this issue.

Upvotes: 0

Aaron Clark
Aaron Clark

Reputation: 31

Not sure the cause of the JIT error, but in case anyone stumbles upon this thread later, I was able to overcome this issue by reinstalling the same version of R (4.1.0 in my case) on my machine, overwriting the old version. Doing so seemed to maintain all my previously installed packages too. Now R & Rstudio works fine on start-up. Give it a try!

Upvotes: 1

Related Questions