statsmaths / cleanNLP

R package providing annotators and a normalized data model for natural language processing
GNU Lesser General Public License v2.1
209 stars 36 forks source link

error init corenlp #37

Closed fahadshery closed 5 years ago

fahadshery commented 5 years ago

I am trying to initialise the backend but getting the following error: > cnlp_init_corenlp("en") Error in rJava::.jnew("edu.stanford.nlp.pipeline.StanfordCoreNLP", prop) : edu.stanford.nlp.util.ReflectionLoading$ReflectionLoadingException: Error creating edu.stanford.nlp.time.TimeExpressionExtractorImpl

Here is my Java version details: java -version java version "11.0.1" 2018-10-16 LTS Java(TM) SE Runtime Environment 18.9 (build 11.0.1+13-LTS) Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.1+13-LTS, mixed mode)

I was also getting the: java heap error when loading this library which I fixed by: options(java.parameters = "-Xmx4096m") before calling any libraries. I am using macOS. I have no problems working with openNLP library which also uses rJava package. Any ideas how to fix this?

statsmaths commented 5 years ago

This seems like a problem with CoreNLP, as mentioned over on stack overflow. It seems that you can either add a java flag or switch to a different java run time version.