Java etc. are placed in the /usr/bin/ 目录下的都是 wrapper,实际上是看 /usr/libexec/java_home 命令所指向的 JAVA_HOME,所以只需要解压 jdk 到 /Library/Java/JavaVirtualMachines directory, and it will be automatically recognized and used. There is no need to configure PATH and JAVA_HOME environment variables.
Oracle JDK for Mac actually installs three parts. One part is the Java command Wrapper that is now installed by default on Apple systems, the second part is the JDK itself, and the third part is the Applet and Java updater, so the pkg provided by Oracle JDK can be decompressed. , and then copy the JDK ontology to the /Library/Java/JavaVirtualMachines directory, which makes it easier to change versions.
Java etc. are placed in the
/usr/bin/
目录下的都是 wrapper,实际上是看/usr/libexec/java_home
命令所指向的 JAVA_HOME,所以只需要解压 jdk 到/Library/Java/JavaVirtualMachines
directory, and it will be automatically recognized and used. There is no need to configure PATH and JAVA_HOME environment variables.Oracle JDK for Mac actually installs three parts. One part is the Java command Wrapper that is now installed by default on Apple systems, the second part is the JDK itself, and the third part is the Applet and Java updater, so the pkg provided by Oracle JDK can be decompressed. , and then copy the JDK ontology to the
/Library/Java/JavaVirtualMachines
directory, which makes it easier to change versions.at
terminal
执行java
命令试试,看看加入环境变量了没.备注:
mac
环境和Linux
是一样的,你可以下载一个jdk
解压,然后把jdk
目录加入环境变量PATH
里面,就可以了.配置环境变量可以在
home
目录下的.bashrc
文件中加入export PATH=$PATH:jdkhome
Need to install
jdk
ah...First open the terminal in the utility and see if the PATH of jre has been added.
Configure jdk
/etc/profile
This can be used for operating systems under the unix system tree.