I happened to upgrade R version to the latest version, 4.0.3 on my Mac OS Catalina,
the reason was that a package needed to be installed with the newest version, So, I just upgraded the R to the latest version, and now I am running into the problems that many packages can not be installed (and if they are installed) the libraries of the packages can not be loaded. I was advised that upgrading R to the latest was not a good decision (in our case: working on the same dataset/environment), so I uninstalled the latest version and back to R version 3.6.3, the problems are still there, can't install packages and load the libraries.
So far, some of those problematic packages are: adegenet, xlsx, deldir.
I have tried to run the command install.packages("lifecycle")
but it didn't help.
as for the library(xlsx), here is the error info:
JVMJ9VM015W Initialization error for library j9gc29(2): Failed to instantiate compressed references metadata. 200M requested
Error: package or namespace load failed for ‘xlsx’:
.onLoad failed in loadNamespace() for 'xlsx', details:
call: .jinit()
error: Cannot create Java virtual machine (-4)
and as for the other issue, I put the screenshot, also it happens that the R studio aborted automatically after I installed and called 70 % of the packages I need.
You are showing two different problems, the first one is related to your Java installation but there is not enough information on what you have posted (at least for me) to help you.
The second error is happening because you are trying to install a package from source (which requires compilation) without having a compiler installed in your system, for compiling packages on macOS you need to install Xcode in your system (not in R), and the recommended development tools for macOS systems.
Please concentrate on one issue at a time and try to provide all the relevant information you can.
could you help with the second one a bit specific what I have to do?
I try too run the commands in my terminal(as I attached)
should I install the Xcode app first?
I tried to install but it says that there is no enough space for this app on my Mac.
Thanks,!
HI @Jefri,
Judging from your screenshot of error messages, there are a couple of things to check. First, it looks like you have the command-line version of xtools installed, but that you might be missing a fortran compiler (make: gfortran: No such file or directory). The version recommended by CRAN is at https://github.com/fxcoudert/gfortran-for-macOS/releases. You don't have to install all of Xcode, as it contains all the libraries for development on iOS, etc.
The second is to make sure you have a Java development kit installed correctly, as the xlsx package depends of rJava, which depends on the java development kit (Different versions can be found at: https://www.oracle.com/java/technologies/javase-downloads.html#javasejdk). Once you have the java development kit installed, In a terminal, if you type " sudo R CMD javareconf", it should return something like: