Another rJava library install error: rJava.rdb' is corrupt

12,270

Solution 1

If the package cannot be decompressed by R, then this error has occurred.

Suggestion#1:

  1. Try restarting R and running the app again.
  2. Sometimes for creation time of .rdb, may some issue occured.

Resource Link: Error in fetch(key) : lazy-load database

Suggestion#2: Quit and restart a clean R session from within R?

If you're in RStudio: command/ctrl + shift + F10

You can also use

.rs.restartR()

Resource Link: Quit and restart a clean R session from within R?

Suggestion#3:

Use a newer version of devtools, It may solve your issue sometimes.

Resource Link: https://github.com/wch/movies/issues/3

Suggestion#4:

Check your JAVA_HOME is correctly set or not.

Use the followings one:

Sys.setenv(JAVA_HOME='...path to JRE...')

OR,

Sys.setenv(JAVA_HOME='C:\\Program Files\\Java\\jdk1.7.0_51\\jre')

Resource Link: https://stackoverflow.com/a/27667945/2293534

Solution 2

You should restart R after re-installing rJava.rdb. see below Stackoverflow link as this is a similar problem

Error in fetch(key) : lazy-load database

Solution 3

I did the following and it worked for me:

  1. Restart R session

.rs.restartR()

  1. Set JavaPath

Sys.setenv(JAVA_HOME='C:\\Program Files\\Java\\jdk1.8.0_131\\jre')

Share:
12,270

Related videos on Youtube

j.Rinehart
Author by

j.Rinehart

Updated on September 15, 2022

Comments

  • j.Rinehart
    j.Rinehart over 1 year

    I am having a time with java related packages this week. I finally got my RWeka working (see HERE), but now I'm having rJava issues.

    The package seems to load up fine, but when I load the library I get the following:

    Error in get(method, envir = home) : 
    lazy-load database '/Library/Frameworks/R.framework/Versions/3.3/Resources/library/rJava/R/rJava.rdb' is corrupt
    In addition: Warning messages:
    1: In .registerS3method(fin[i, 1], fin[i, 2], fin[i, 3], fin[i, 4],  :
    restarting interrupted promise evaluation
    2: In get(method, envir = home) :
    restarting interrupted promise evaluation
    3: In get(method, envir = home) : internal error -3 in R_decompress1
    Error: package or namespace load failed for ‘rJava’
    

    Any ideas would be greatly appreciated!

  • j.Rinehart
    j.Rinehart almost 7 years
    This worked! I love it when the simple answer works!
  • Rγσ ξηg Lιαη Ημ
    Rγσ ξηg Lιαη Ημ over 6 years
    Suggestion#4 is works for me. Set the path and restart the RGui.exe.