在R控制台上执行库('RJDBC')显示java 6安装消息

时间:2014-12-14 14:47:54

标签: java r macos rjdbc

我试图在Mac OS X系统中使用RJDBC通过R控制台访问一个mysql数据库,但是在" >图书馆(' RJDBC')"。立即显示一条消息,指示必须安装旧的Java 6 mac os版本。

我已经安装了打包包#34; > install.packages(' RJDBC',依赖= TRUE)"

我的系统有: OSX = Mac Os X(约塞米蒂) R版本3.1.2(2014-10-31) 安装java 7并在我的./bash_profile文件中设置JAVA_HOME env变量。

echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/jdk1.7.0_60.jdk/Contents/Home

如果有用的话

R CMD javareconf
Java interpreter : /Library/Java/JavaVirtualMachines/jdk1.7.0_60.jdk/Contents/Home/jre/bin/java
Java version     : 1.7.0_60
Java home path   : /Library/Java/JavaVirtualMachines/jdk1.7.0_60.jdk/Contents/Home
Java compiler    : /Library/Java/JavaVirtualMachines/jdk1.7.0_60.jdk/Contents/Home/bin/javac
Java headers gen.: /Library/Java/JavaVirtualMachines/jdk1.7.0_60.jdk/Contents/Home/bin/javah
Java archive tool: /Library/Java/JavaVirtualMachines/jdk1.7.0_60.jdk/Contents/Home/bin/jar
System Java on OS X

trying to compile and link a JNI progam 
detected JNI cpp flags    : -I/System/Library/Frameworks/JavaVM.framework/Headers
detected JNI linker flags : -framework JavaVM
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/System/Library/Frameworks/JavaVM.framework/Headers -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include    -fPIC  -Wall -mtune=core2 -g -O2  -c conftest.c -o conftest.o
conftest.c:1:10: fatal error: 'jni.h' file not found
#include <jni.h>
         ^
1 error generated.
make: *** [conftest.o] Error 1
Unable to compile a JNI program


JAVA_HOME        : /Library/Java/JavaVirtualMachines/jdk1.7.0_60.jdk/Contents/Home
Java library path: 
JNI cpp flags    : 
JNI linker flags : 
Updating Java configuration in /Library/Frameworks/R.framework/Resources
Done.

我做错了什么?我甚至查看了一篇旧帖子how to get rJava 0.9-3 to work on OS X 10.7.4 with Oracle Java 1.7?http://mailman.rz.uni-augsburg.de/pipermail/stats-rosuda-devel/,但我还没有能够让它发挥作用,有人可以帮助我吗?

1 个答案:

答案 0 :(得分:1)

不确定您是否已经解决了这个问题,但是您需要安装Java for OS X 2014-001,找到here ...