Home > Java > javaTutorial > body text

Detailed explanation of installing Java and configuring environment variables on MAC system

黄舟
Release: 2017-03-22 10:13:49
Original
1630 people have browsed it

This article mainly introduces the relevant information on installing java and configuring environment variables on MAC system. Friends in need can refer to

MAC Configuring java environment variables

1. List all Java version information

/usr/libexec/java_home -V
Copy after login

2. Modify the .bash_profile file

cd ~

touch .bash_profile

vi .bash_profile
Copy after login

3. Configure the JDK environment variable content and enter wq to save

export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home #jdk安装路径  
export PATH=$JAVA_HOME/bin:$PATH 
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
Copy after login

4.UpdateConfiguration file

source .bash_profile
Copy after login

5. Check the environment variable JDK version

java -version
Copy after login

The above is the detailed content of Detailed explanation of installing Java and configuring environment variables on MAC system. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
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!