How to configure java environment variables under macos system

王林
Release: 2020-11-26 15:27:28
forward
2724 people have browsed it

How to configure java environment variables under macos system

The specific configuration steps are as follows:

1. Edit bash_profile

vim ~/.bash_profile
输入以下内容并保存

export JAVA_HOME=`/usr/libexec/java_home`
export CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME 
export PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin
Copy after login

2. Make the environment variables effective

source ~/.bash_profile
Copy after login

3. Verify

tianshl@tianshl ~ $ echo $PATH
Copy after login

4. Note

Before using fish, you must exit fish

/usr/libexec/java_home This command can output the path of JAVA_HOME

Related recommendations: macos

The above is the detailed content of How to configure java environment variables under macos system. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!