简体   繁体   中英

installing Java 7 or above on OSx Mavericks

Just now I installed java 8 required for Android Studio(7 or version above), hoping after install my java version will automatically pointing to the latest version but but I think it is just not pointing it is also not there.

$:/System/Library/Frameworks/JavaVM.framework/Versions$ ll
total 64
drwxr-xr-x  11 root  wheel  374 Jan  5  2014 .
drwxr-xr-x  12 root  wheel  408 Feb 11  2015 ..
lrwxr-xr-x   1 root  wheel   10 Jan  5  2014 1.4 -> CurrentJDK
lrwxr-xr-x   1 root  wheel   10 Jan  5  2014 1.4.2 -> CurrentJDK
lrwxr-xr-x   1 root  wheel   10 Jan  5  2014 1.5 -> CurrentJDK
lrwxr-xr-x   1 root  wheel   10 Jan  5  2014 1.5.0 -> CurrentJDK
lrwxr-xr-x   1 root  wheel   10 Jan  5  2014 1.6 -> CurrentJDK
lrwxr-xr-x   1 root  wheel   10 Jan  5  2014 1.6.0 -> CurrentJDK
drwxr-xr-x   8 root  wheel  272 Jan  6  2014 A
lrwxr-xr-x   1 root  wheel    1 Jan  5  2014 Current -> A
lrwxr-xr-x   1 root  wheel   59 Jan  5  2014 CurrentJDK -> /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents

This is all I have so where did new java 8 version got installed to ? how do I manually update paths ?

doing which java in shell points to /usr/bin/java which is further symlink to /usr/bin/java -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java

I need a path to put here in image below: Android Studio Java 7 +安装路径

I got my answer what I was looking for,

so its install at this path: /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/

echo 'export JAVA_HOME="/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home"' >> ~/.bash_profile

by now you open a new shell you should get java -fullversion result in java full version "1.8.0_66-b17"

follow below steps to add to jenv/ or should I say add via jenv.

however you cannot add /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home to jenv.

to add to jenv I created a symlink in /System/Library/Frameworks/JavaVM.framework/Versions using

sudo ln -s /Library/Internet\\ Plug-Ins/JavaAppletPlugin.plugin/Contents/ 1.8

and then did jenv add /System/Library/Frameworks/JavaVM.framework/Versions/1.8/Home/ oracle64-1.8.0.66 added

1.8.0.66 added
1.8 added

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM