By default, if you install the Oracle JDK, it will not be used as the default java environment.
All the system symlinks from /usr/bin/java* do forward to /System/Library/Frameworks/JavaVM.framework/Versions/Current instead of CurrentJDK.
How can I change these, is there any script that can change default java?
Check the instructions of Oracle . You can use Applications -> Utilities -> Java
to switch the default JDK.
Set your JAVA_HOME to your JDK 7.
Check this http://www.mkyong.com/java/how-to-set-java_home-environment-variable-on-mac-os-x/
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.