代码之家  ›  专栏  ›  技术社区  ›  Mr. T Andres Pinzon

无法为EclipseStatet插件安装rj包

  •  -1
  • Mr. T Andres Pinzon  · 技术社区  · 6 年前

    here ,我试图安装程序包 rj-2.1

    install.packages(c("rj", "rj.gd"), repos="http://download.walware.de/rj-2.1")
    

    rj rj.gd

    Installing packages into ‘/usr/local/lib/R/site-library’
    (as ‘lib’ is unspecified)
    

    Warning message:
    In install.packages(c("rj", "rj.gd"), repos = "http://download.walware.de/rj-2.1") :
      installation of package ‘rj’ had non-zero exit status
    

    仔细查看控制台输出会发现以下错误消息:

    checking Java support in R... configure: error: cannot determine complete java config
        JAVA_HOME: /usr/lib/jvm/default-java
        JAVA     : /usr/lib/jvm/default-java/bin/java
        JAVAC    : /usr/lib/jvm/default-java/bin/javac
        JAVAH    : 
        JAVA_CPPFLAGS: -I/usr/lib/jvm/default-java/include -I/usr/lib/jvm/default-java/include/linux
        JAVA_LIBS: -L/usr/lib/jvm/default-java/lib/server -ljvm
        JAR      : /usr/lib/jvm/default-java/bin/jar
    R is not configured with full Java support. Please make sure
    an JDK is installed and run
        R CMD javareconf
    as root to add Java support to R.
    
    If you don't have root privileges, run
        R CMD javareconf -e
    to set all Java-related variables and then install the package.
    ERROR: configuration failed for package ‘rj’
    * removing ‘/usr/local/lib/R/site-library/rj’
    * restoring previous ‘/usr/local/lib/R/site-library/rj’
    

    当我运行建议的命令时

    sudo R CMD javareconf
    

    Java interpreter : /usr/lib/jvm/default-java/bin/java
    Java version     : 10.0.2
    Java home path   : /usr/lib/jvm/default-java
    Java compiler    : /usr/lib/jvm/default-java/bin/javac
    Java headers gen.: 
    Java archive tool: /usr/lib/jvm/default-java/bin/jar
    
    trying to compile and link a JNI program 
    detected JNI cpp flags    : -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux
    detected JNI linker flags : -L$(JAVA_HOME)/lib/server -ljvm
    gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I/usr/lib/jvm/default-java/include -I/usr/lib/jvm/default-java/include/linux     -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c conftest.c -o conftest.o
    g++ -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o conftest.so conftest.o -L/usr/lib/jvm/default-java/lib/server -ljvm -L/usr/lib/R/lib -lR
    
    
    JAVA_HOME        : /usr/lib/jvm/default-java
    Java library path: $(JAVA_HOME)/lib/server
    JNI cpp flags    : -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux
    JNI linker flags : -L$(JAVA_HOME)/lib/server -ljvm
    Updating Java configuration in /usr/lib/R
    Done.
    

    尽管如此 之后仍然会产生相同的错误消息。我看了一眼 /usr/local/lib/R/site-library 已经更新,但是 rj型 仍然是以前的版本。启动R控制台会产生错误消息

    eclipse.buildId=4.8.0.I20180611-0500
    java.version=10.0.2
    java.vendor=Oracle Corporation
    BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_GB
    Framework arguments:  -product org.eclipse.epp.package.java.product
    Command-line arguments:  -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.java.product
    
    de.walware.statet.r.console.ui
    
    Launching the R Console was cancelled, because it seems starting the R engine failed.
    Please make sure that R package 'rj' (2.1 or compatible) is installed and that the R library paths are set correctly for the R environment configuration 
    

    有什么办法,怎么得到 rj型 安装?

    openjdk 10.0.2 2018-07-17
    OpenJDK Runtime Environment (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.1)
    OpenJDK 64-Bit Server VM (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.1, mixed mode)
    

    更新:
    在不知情的情况下,安装了 rj型 rj.gd型 从一个 Rterm 控制台现在工作了。中的文件 确实是最新的 Rterm公司 控制台没有任何错误消息。
    尽管如此,在创建和运行 RJ

    Launching the R Console was cancelled, because it seems starting the R engine failed. 
    Please make sure that R package 'rj' (2.1 or compatible) is installed and that the R library paths are set correctly for the R environment configuration 'Rstatet36'.
    

    我也重新定义了 Preferences>Statet>R environment Run Configurations 没有效果。

    1 回复  |  直到 6 年前
        1
  •  1
  •   Mr. T Andres Pinzon    6 年前

    它确实是错误的Java环境。安装不需要很长时间,如果你知道,做什么,但是发现是相当乏味的:

    sudo apt install openjdk-8-jdk sudo update-alternatives --config java 可能有帮助,但事实并非如此。所以不要这样做。

    enter image description here 有选择 ADD 并指定文件夹,在本例中为/usr/lib/jvm/java-8-opdenjdk-amd64。单击“确定”。

    3) 转到“运行”>“运行配置”并双击 R console RJ (default)

    enter image description here

    4) 转到标签页 JRE 并从中选择Java8 Alternate JRE enter image description here

    Apply Run