I am unable to access coreNLP
in R on a Mac running High Sierra. I am uncertain what the problem is, but it seems that every time I try again to get coreNLP
to work, I am faced with a different error. I have JDK 9.0.4. Please see my code below for what I am attempting to do, and the error that stops me.
My previous attempt I was able to get initCoreNLP()
to run and load some elements of the packages, but it would fail on others. When I then attempted to run annotateString()
, it would throw the error Error Must initialize with 'int CoreNLP'!
.
I have downloaded and re-downloaded the coreNLP
Java archive many times and still no luck! See image for contents of my coreNLP
R package folder located at /Library/Frameworks/R.framework/Versions/3.4/Resources/library/coreNLP
.
Do you know how I can successfully initialize coreNLP
?
dyn.load("/Library/Java/JavaVirtualMachines/jdk-9.0.4.jdk/Contents/Home/lib/server/libjvm.dylib")
library(NLP)
library(coreNLP)
> downloadCoreNLP()
trying URL 'http://nlp.stanford.edu/software//stanford-corenlp-full-2015-12-09.zip'
Content type 'application/zip' length 403157240 bytes (384.5 MB)
==================================================
downloaded 384.5 MB
> initCoreNLP()
[main] INFO edu.stanford.nlp.pipeline.StanfordCoreNLP - Searching for resource: StanfordCoreNLP.properties
Error in rJava::.jnew("edu.stanford.nlp.pipeline.StanfordCoreNLP", basename(path)) :
edu.stanford.nlp.io.RuntimeIOException: ERROR: cannot find properties file "StanfordCoreNLP.properties" in the classpath!
Per our discussion.
My sense is your Java / R configuration dependency issue. Thus, it appears that
rJava
is dependent on the version ofjava
used andcoreNLP
is dependent onrJava
.thus we can set the dlynlib version to 1.8.X, uninstall rJava, reinstall rJava then reinstall coreNLP.
Setup a particular version of java in RStudio