• R安装时的问题


    R在安装  rJava 包是可能 安装不成功

    问题1:

    checking Java support in R... present:
    interpreter : '/usr/lib/jvm/jre/bin/java'
    archiver    : '/usr/lib/jvm/jre/../bin/jar'
    compiler    : '/usr/lib/jvm/jre/../bin/javac'
    header prep.: '/usr/lib/jvm/jre/../bin/javah'
    cpp flags   : '-I/usr/lib/jvm/java/include I/usr/lib/jvm/java/include/linux'
    java libs   : '-L/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64/server -ljvm'
    checking whether Java run-time works... ./configure: line 3729: /usr/lib/jvm/jre/bin/java: No such file or directory
    no configure: error: Java interpreter '/usr/lib/jvm/jre/bin/java' does not work
    

      

    原因在于 rJava默认会找系统JAVA_HOME 如果没有配置 JAVA_HOME 则会使用   /usr/lib/jvm/jre/bin/java  该目录可能在本机没有

    解决办法是指定JAVA_HOME,之后重置R中环境变量

    export JAVA_HOME=$PWD/env/java/jdk8
    
    R CMD javareconf      
    

    问题2

    checking Java support in R... present:
    interpreter : '/usr/bin/java'
    archiver    : '/usr/bin/jar'
    compiler    : '/usr/bin/javac'
    header prep.: '/usr/bin/javah'
    cpp flags   : '-I/usr/lib/jvm/java-6-sun-1.6.0.20/jre/../include -I/usr/lib/jvm/java-6-sun-1.6.0.20/jre/../include/linux'
    java libs   : '-L/usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/amd64/server -L/usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/amd64 -L/usr/lib/jvm/java-6-sun-1.6.0.20/jre/../lib/amd64 -L -L/usr/java/packages/lib/amd64 -L/usr/lib64 -L/lib64 -L/lib -L/usr/lib -ljvm'
    checking whether JNI programs can be compiled... yes
    checking JNI data types... configure: error: One or more JNI types differ from the corresponding native type. You may need to use non-standard compiler flags or a different compiler in order to fix this.
    ERROR: configuration failed for package ‘rJava’
    

     该问题是没有配置 LD_LIBRARY_PATH  环境变量,解决办法和问题1 一样

    export LD_LIBRARY_PATH=$JAVA_HOME/jre/lib/amd64:$JAVA_HOME/jre/lib/amd64/server
    
    R CMD javareconf
    

      

    所有该种问题可以一起设置

    export JAVA_HOME=$PWD/env/java/jdk8
    export LD_LIBRARY_PATH=$JAVA_HOME/jre/lib/amd64:$JAVA_HOME/jre/lib/amd64/server
    
    R CMD javareconf
    

      

  • 相关阅读:
    微信公众号教程(5)自动回复操作案例
    微信公众号教程(4)微信公众平台编辑模式介绍
    微信公众号教程(3)微信公众平台群发消息
    微信公众号教程(2)微信公众平台后台介绍
    微信公众号教程(1)微信公众账号注册、设置、登陆
    二级c程序设计题(2)
    二级c程序设计题(1)
    C++经典编程题#6:分配病房
    C++经典编程题#5:寻找下标
    python-----面向对象三大特性
  • 原文地址:https://www.cnblogs.com/yunfeiqi/p/7773698.html
Copyright © 2020-2023  润新知