How to Set up a Java Development Environment under Mac OS and configure Java environment variables, osjava

Source: Internet
Author: User

How to Set up a Java Development Environment under Mac OS and configure Java environment variables, osjava
1. Open the terminal and search in the finder (This MAC) to find the Terminal 2. In cdlouiedeAir :~ Cdlouie $ (cdlouie is my computer user name) and enter sudo vim/etc/profile 3. enter the user name and password of the computer after the password. The password is not displayed. then, press the I key editor status ("/etc/profile" [readonly] 16L, 369C) at any location to switch to INSERT (-- INSERT -- W10: Warning: Changing a readonly file) after you move the cursor to the last line of fi, press enter to wrap the line and insert the following code: # Here is the JAVA environment variable JAVA_HOME = "Library/Java/JavaVirtualMachines/jdk1.8.0 _ 121.jdk/ Contents/Home/" CLASS_PATH = "$ JAVA_HOME/lib" PATH = ". $ PATH: $ JAVA_HOME/bin "5. press ESC to exit the editing status. 6. Press shift + colon, a colon will appear in the editor, and then enter wq! Press enter to save. 7. Check and enter sudo vim/etc/profile again to check whether the inserted code is successfully saved. 8. Note: The jdk version of the inserted code can be queried using the terminal command: java-version.

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.