MAC OX configuration JDK environment variable

Source: Internet
Author: User

has been using Windows development, is now a Mac development installation JDK configuration environment A little trouble, consulted a number of articles, found a simple record down.

1, open the Mac comes with terminal terminal;

2, enter the current user home directory, cd ~;(Default User directory is not required)

3, temporary authorization, sudo su;

4, enter the system password (lock password does not display input);

5. Create a. bash_profile file, touch. Bash_profile (if there is no need to create a new, you can directly verify the sixth step and then choose whether to perform this step);

6. Open the. bash_profile file, opening bash_profile (can open then new success);

7, Vim. Bash_profile Enter the command below the JDK, note that the value of Java_home is adjusted according to its own directory, I installed the JDK1.8:

Java_home=/library/java/javavirtualmachines/jdk1.8.0_65.jdk/contents/home

classpaht=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar

Path= $JAVA _home/bin: $PATH:

Export Java_home

Export CLASSPATH

Export PATH

Save and exit;

8. Read and execute the commands in the file: source. bash_profile;

9. Enter Java-version in terminal to display JDK information, then the configuration is successful.

MAC OX configuration JDK environment variable

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.