2016-06-22 1 views
0

우분투에서 R로 작업 중이므로 CoreNLP 패키지를 사용하고 싶습니다. 이상한 동작이 있습니다.R의 CoreNLP는 RStudio에서는 작동하지 않지만 쉘에서는 잘 작동합니다.

$ R 

R version 3.2.2 (2015-08-14) -- "Fire Safety" 
Copyright (C) 2015 The R Foundation for Statistical Computing 
Platform: x86_64-pc-linux-gnu (64-bit) 

R is free software and comes with ABSOLUTELY NO WARRANTY. 
You are welcome to redistribute it under certain conditions. 
Type 'license()' or 'licence()' for distribution details. 

    Natural language support but running in an English locale 

R is a collaborative project with many contributors. 
Type 'contributors()' for more information and 
'citation()' on how to cite R or R packages in publications. 

Type 'demo()' for some demos, 'help()' for on-line help, or 
'help.start()' for an HTML browser interface to help. 
Type 'q()' to quit R. 

[Previously saved workspace restored] 

> library(rjava) 
Error in library(rjava) : there is no package called ‘rjava’ 
> library(rJava) 
> library(coreNLP) 
> initCoreNLP() 
Searching for resource: config.properties 
Adding annotator tokenize 
TokenizerAnnotator: No tokenizer type provided. Defaulting to PTBTokenizer. 
Adding annotator ssplit 
Adding annotator pos 
Reading POS tagger model from edu/stanford/nlp/models/pos-tagger/english-left3words/english-left3words-distsim.tagger ... done [2.4 sec]. 
Adding annotator lemma 
Adding annotator ner 
Loading classifier from edu/stanford/nlp/models/ner/english.all.3class.distsim.crf.ser.gz ... done [6.1 sec]. 
Loading classifier from edu/stanford/nlp/models/ner/english.muc.7class.distsim.crf.ser.gz ... done [4.1 sec]. 
Loading classifier from edu/stanford/nlp/models/ner/english.conll.4class.distsim.crf.ser.gz ... done [3.3 sec]. 
Initializing JollyDayHoliday for SUTime from classpath: edu/stanford/nlp/models/sutime/jollyday/Holidays_sutime.xml as sutime.binder.1. 
Reading TokensRegex rules from edu/stanford/nlp/models/sutime/defs.sutime.txt 
Reading TokensRegex rules from edu/stanford/nlp/models/sutime/english.sutime.txt 
Reading TokensRegex rules from edu/stanford/nlp/models/sutime/english.holidays.sutime.txt 
Adding annotator parse 
Loading parser from serialized file edu/stanford/nlp/models/lexparser/englishPCFG.ser.gz ... done [4.1 sec]. 
Adding annotator dcoref 
Adding annotator sentiment 
> library(rJava) 
> .jinit() 
[1] 0 
> .jcall("java/lang/System","S","getProperty","java.version") 
[1] "1.8.0_91" 
> 

을하지만 동일한 사용자와 동일한 시스템에 RStudio 서버를 사용하는 경우, 나는이 얻을 :

> library(rJava) 
> library(coreNLP) 
> initCoreNLP() 
Error in rJava::.jnew("edu.stanford.nlp.pipeline.StanfordCoreNLP", basename(path)) : 
    java.lang.UnsupportedClassVersionError: edu/stanford/nlp/pipeline/StanfordCoreNLP : Unsupported major.minor version 52.0 
> .jinit() 
[1] 0 
> .jcall("java/lang/System","S","getProperty","java.version") 
[1] "1.7.0_67" 

을 내가 쉘을 사용하는 경우, 모든 예를 들어 내가 실행할 수 있습니다, 괜찮습니다 처음에는 터미널이나 RStudio Server에서 작동하지 않았습니다.

  1. 내가 http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html에서 자바 다운로드, JDK에-8u91-리눅스 x64.tar.gz 파일 : 그것은 터미널에서 작동하도록하기 위해 나는이 단계를 따랐다. 이 RStudio 서버에서 터미널에서 작동하지만 왜 /usr/lib/jvm/jdk1.8.0_91
  2. 에서
  3. 압축 해제가 마지막으로 sudo JAVA_HOME=/usr/lib/jvm/jdk1.8.0_91 R CMD javareconf

그래서 실행, 나는 이해할 수 없다. RStudio Server가 올바른 Java를로드 할 수 없다고 생각하는 이유는 무엇입니까?

귀중한 모든 의견을 보내 주셔서 감사합니다.

모든 최고의

아구스틴

답변

1

당신은 RStudio 지원을 요청 할 수 있습니다. R 스크립트는 Java 용 환경을 설정하므로 내 생각에 RStudio 서버가이를 수행하지 못합니다. 어떻게 시작해야할지 모르지만 R 스크립트를 통해 부트 스트랩을하면 더 많은 행운을 빕니다.

R CMD <command to start the server> 
관련 문제