0

I have been using R for a while without problems. Just a sudden, i have several issues with Rjava errors. I searched online for clues, but found none.

The error is: Warning in install.packages : package ‘rJava’ is in use and will not be installed

and now every time i run install.packages, i get a pop box that says uploading loaded packages.....

sessionInfo() R version 3.5.2 (2018-12-20) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale: [1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252 [4] LC_NUMERIC=C LC_TIME=English_United States.1252

attached base packages: [1] stats graphics grDevices utils datasets methods base

other attached packages: [1] miniUI_0.1.1.1 tabulizer_0.2.2 rJava_0.9-10

Every time i start RStudio, i get this error:

Loading required package: rJava Error: package or namespace load failed for ‘rJava’ in exists(what, mode = "function", envir = ns): reached elapsed time limit

I made sure that i had java versions for 64 bit and the environment was set correctly.

install.packages("rJava");library(rJava)

I want to have a solution so that rjava loads correctly when i start RStudio or install rjava

  • Try using unloadNameSpace(on my phone now so forgot the spelling) followed by uninstall and reinstall. – NelsonGon Feb 09 '19 at 08:51
  • Are you loading packages automatically when you start? For me, usually when I get errors like this I will start R in terminal with `--vanilla` and then I can install things that are loaded by default. – Elin Feb 09 '19 at 09:12

1 Answers1

0

This looks like you are loading tabulizer on startup, which also loads rJava. I suspect the reason is that you have a file called .RDATA saved in your default working environment. That makes RStudio open and load it on starting. In that file, I suspect there is an object which needs tabulizer. This is why it is loaded on default and why you have these problems.

The solution is to delete or rename the .RDATA file. Use getwd() to find out your current working directory. You might need to make hidden files visible.

JBGruber
  • 11,727
  • 1
  • 23
  • 45
  • Thanks! I deleted the .rdata files and changed the work directory. Now I am getting this error when tried to run install.packages("xlsx"). package ‘xlsx’ successfully unpacked and MD5 sums checked Warning in install.packages : cannot remove prior installation of package ‘xlsx’ The downloaded binary packages are in C:\Users\name\AppData\Local\Temp\RtmpKYlF0d\downloaded_packages Error in library(xlsx) : there is no package called ‘xlsx’ – user6437539 Feb 09 '19 at 22:10
  • Try starting RStudio as administrator and install again. That usually solves it for me. – JBGruber Feb 09 '19 at 23:22
  • Thank you JB for your help. I am still getting the same error after i ran rstudio as administrator. I am wondering, as a newbie to R, if i uninstall R, Java, rstudio and reinstall them again would help – user6437539 Feb 10 '19 at 03:55
  • I'm not even sure that would work. The problem is well known and only exists on windows but it's still tricky to find out what works in your situation. Maybe this helps: https://stackoverflow.com/a/52815761/5028841 – JBGruber Feb 10 '19 at 11:26
  • Thanks again JB. I uninstalled R, rjava, java, and Rstudio, and deleted all associated folders. Then reinstalled them and that worked for me. Thanks again--EK – user6437539 Feb 12 '19 at 13:56