I'm following the instructions on this link to use coreNLP https://github.com/statsmaths/coreNLP
However, I found this error
> library(coreNLP)
Error in get(method, envir = home) :
lazy-load database '/Users/apple/Library/R/3.2/library/coreNLP/R/coreNLP.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 ‘coreNLP’
After encountering the
java.lang.UnsupportedClassVersionError: edu/stanford/nlp/pipeline/StanfordCoreNLP : Unsupported major.minor version 52.0
error message:You need to
R CMD javareconf
on the command line, and thenrestart R / RStudio
make sure that a swap file (or swap partition) exists on your machine. call
free
to check if there is a line in the output that starts withswap
and the values on that line are not zero.I use ubuntu, my java 8 libjvm.so is here:
/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server/libjvm.so
You can do this in your .Rprofile file. Add this line, perhaps at the bottom of the file:
Sys.setenv(LD_LIBRARY_PATH=paste0(Sys.getenv("LD_LIBRARY_PATH"), ":", "/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server/" ))
When I do this in R:
I get this result:
(*) How to see the default jvm on Linux:
Result
To show all available alternatives, use
Result (on my machine):
Change alternatives:
Just play a bit with update-alternatives.
The instructions above from https://github.com/statsmaths/coreNLP works, possibly something went it was installing the library in R
Re-run these command to reinstall the
corenlp
wrapper:You should see this if the package is not corrupted:
Otherwise
devtools
should do a reinstall of the package.