Recently, I want to learn that R installed an R and rstudio yesterday. After the installation, I wanted to find an exercise to deal with Excel, so I found an xlsx package and reported errors all the time, as shown in the following figure:
After a day of trouble, I still haven’t solved it. Finally, I found a solution online, so I recorded it. I hope it will be useful to other people with the same problem
Solution: execute the command on the MAC terminal: sudo ln -s $(/usr/libexec/java_home)/jre/lib/server/libjvm.dylib /usr/local/lib
Then execute in rstudio library(“xlsx”)
Referenced address: https://stackoverflow.com/questions/30738974/rjava-load-error-in-rstudio-r-after-upgrading-to-osx-yosemite