Build a Java development environment under Mac

Source: Internet
Author: User

One installation JDK

Download the dedicated jdk1.7 under Mac:

http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html

After installation, open a terminal input, java-version, confirm the JDK version number jdk1.7

Java- version " 1.7.0_79 "  1.7. 0_79-24.79-b02, Mixed mode)
Two install Eclipse

Download the dedicated Eclipse for EE version under Mac:

http://www.eclipse.org/downloads/

To view the JRE used in eclipse:

1) Open Eclipse, Preferences, java->installed JREs, see the list of JRE on the right, if the jdk1.7 is already installed, the default location is the following address:

/library/java/javavirtualmachines/jdk1. 7. 0_79.jdk/contents/home

Otherwise, click Add, select Standard VM, point to the location of the JDK7 in the path, then you can.

2) then click Java-Compiler, set the compilation level to 1.7, you can enjoy the language features of JDK1.7.

Three configuration Java_home environment variables

1 Understanding the configuration file under Mac

/etc/profile   globally shared configuration, which reads this file /etc/BASHRC    (typically add system-level environment variables in this file) global (public) configuration, bash When the shell executes, the file is read in any way. ~/.bash_profile  (typically add user-level environment variables to this file)

Note: In a Linux system, files with a file name prefix of. File names are hidden files and are viewed using the ls-a command.

2. Configuring the Environment

First open the configuration file, where the global profile/etc/profile is used,

Vi/etc/profile

Write the following into the configuration file,

Java_home=/library/java/javavirtualmachines/jdk1. 7.0_79.jdk/contents/home
paht= $JAVA _home/bin: $PAHT

Export Java_home
Export PATH

and then save. Then restart or use the following command to make the configuration of the environment variable work.

Source/etc/profile

Build a Java development environment under Mac

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.