how to get java V8 in OS X Sierra
I did install java V8, but when I ask "java -version" the answer is java V6.
I need recognize java V8 to use some packages in R.
I did install java V8, but when I ask "java -version" the answer is java V6.
I need recognize java V8 to use some packages in R.
If you are getting errors when trying to load the rJava library like this:
Error: package or namespace load failed for ‘rJava’:
.onLoad failed in loadNamespace() for 'rJava', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.4/Resources/library/rJava/libs/rJav a.so':
dlopen(/Library/Frameworks/R.framework/Versions/3.4/Resources/library/rJava/lib s/rJava.so, 6): Library not loaded: @rpath/libjvm.dylib
Referenced from: /Library/Frameworks/R.framework/Versions/3.4/Resources/library/rJava/libs/rJava .so
Reason: image not found
Follow the instructions here: r - trouble installing and loading rJava on mac El Capitan - Stack Overflow
Note that the instructions use the path to an old version of Java 8.
If you go to Terminal and use this command:
/usr/libexec/java_home -v "1.8+"
it will return a path you can copy and paste into the appropriate places in RStudio Console.
Also, note that Step 1 is in Terminal and the rest is in RStudio or R console.
What is in /Library/Java/Virtual Machines
I’m not at a Mac, so the last part may be slightly different. It should be similar.
That's
/Library/Java/JavaVirtualMachines
You should have a folder for 1.6 and a folder for 1.8.
If 1.8 is missing, then you didn't install the Java SE JDK.
That's a different error that probably has nothing to do with Java. You may have to ask the people that created rJava.
Thanks Barney. I did follow the first instruction (jorges-mbp-3:~ JFranco$ /usr/libexec/java_home -v "1.8+"), did obtain the answer :
Unable to find any JVMs matching version "1.8+".
/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
But when I go to java control panel did get the attached answer
thanks a lot.
Hello Barney, Thanks a lot, I had advanced, as you can see I am a beginner.
Did install java.jdk and java.jrs, next did follow the instructions as you can see below (using terminal):
> options("java.home")
$java.home
NULL
> options("java.home"="/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Content s/Home/jre")
> Sys.setenv(JAVA_HOME='/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Conten ts/Home')
> Sys.setenv(LD_LIBRARY_PATH='$JAVA_HOME/jre/lib/server')
> install.packages("rJava")
Installing package into ‘/Users/JFranco/Library/R/3.4/library’
(as ‘lib’ is unspecified)
trying URL 'https://mran.microsoft.com/snapshot/2017-09-01/bin/macosx/el-capitan/contrib/3.4 /rJava_0.9-8.tgz'
Content type 'application/octet-stream' length 627959 bytes (613 KB)
==================================================
downloaded 613 KB
The downloaded binary packages are in
/var/folders/gp/hypk6wk539j2wn8xhlyfbs3c0000gn/T//Rtmp7xQ3Lu/downloaded_packages
> library(rJava)
*** caught segfault ***
address 0x18, cause 'memory not mapped'
Thanks Barney, the package is "corehunter"
Do you need it only for Web Applets, or do you need to run Java programs (e.g. .jar) on your Mac?
The Java.com site only installs the JRE for web applets and the java -version command will not report on the JRE plug-in.
If you want the latter, then Kurt has linked to it.
Thanks Kurt. Yes I did it, and did install "jre-8u144-macosx-x64", in java control panel the version is recognized. But the answer in monitor is as below. I need java 8 to use a package R, using RSTUDIO.
192:~ JFranco$ java -version
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-468-11M4833)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-468, mixed mode)
The Terminal output means you also have Apple's Java 6 installed. That doesn't mean Java 8 has been installed incorrectly. Terminal simply doesn't report it.
It's possible RStudio is looking for the JDK version of Java 8, rather than the simpler runtime version. Check with the maker of JDK before installing any other Java versions. They should be able to steer you in the right direction.
Thanks, I need run a package in R, not java programs.
If it's looking for Java, then at least part of the application package is a Java app.
Since you have Java 6 installed, try /usr/libexec/java_home (not JAVA_HOME) in Terminal. It will list the path of all installed Java versions.
Depending on the response from RStudio, you could just java_home to set the JAVA_HOME environment variable so that the java command runs that version.
$ export JAVA_HOME=`/usr/libexec/java_home -v 1.8+`
However, you may have to explicitly set the java home path in that R package. Which package is it?
You need to get Java 8 from Oracle.
Thanks, I need run a package in R, not java programs.
I just installed both Apple's Legacy Java 6 and Oracle's Java 8 SE.
java -version and java_home both only show me the 1.8 version.
Just wondering if you actually got it installed correctly.
how to get java V8 in OS X Sierra