The most detailed Java environment building for Javaweb Development (Mac Version)

Source: Internet
Author: User

It takes about 5 minutes to read the text.

I've previously shared the configuration of the Java environment under Windows, and this time it's all about installing the Java environment under MAC. First, the MAC system already has the default Java, but because the use is inconvenient, here teaches everybody a more convenient method, and the management is convenient. It is also convenient for us to configure the idea, Eclipse.

The installation configuration for our Java environment starts below.

1. Open the Java website

Http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Here you can choose the Java version you want to download, here we take java1.8 as an example to explain. Before downloading, we need to accept the agreement before we can download it.

Here's why I chose the Linux version of the JDK to download, not the Mac version of the JDK, mainly because if we download the Mac version of the JDK when installed, we can not choose the installation directory, that is, it is installed by default, you still have to go to Google Mac under the JDK default installation directory, so not many times at once. Second, because the Mac is a native Unix system, you can choose the corresponding Linux version, and it is more convenient for us to manage. After downloading it through the link above, we can see the file locally.

If you feel that the above download is not large enough, we can use the command to download directly in the command, we can use the wget command to download the JDK, as follows:

Http://download.oracle.com/otn-pub/java/jdk/8u172-b11/a58eab1ec242421181065cdc37240b08/jdk-8u172-linux-x64.tar.gz

Execute the following on the command line, so that after downloading the result is the same as we have all the browser download, like which can be used in which way to download.

2. Unzip the downloaded JDK file.

The downloaded file is a file in tar.gz format, where we can decompress through the tar command, this format file is actually equivalent to the RAR file under Windows, tar can unzip or compress the file, download we use the command to unzip the downloaded JDK file. Here we first move the downloaded JDK files to our tool catalog, convenient for our next use and find. I've moved the JDK under the Tools directory, so there's no need to move again, and if we need to move the file, we can move it through the MV command. Unzip the file.

After the decompression is complete, we will get the following folder, we can go to the folder and view the contents under the folder.

Here our Java installation is half done, in fact, said the installation is not, we just download the file, and do understand the work of pressure. Also left the environment variable settings, when it comes to the setting of environment variables, presumably many will think it must be very complex, in fact, this is a self-limiting idea, in the Mac or Linux system under the environment variable settings is actually very simple, below you will see.

3. View the directory of the JDK and configure the environment variables

Before configuring the Java environment variables, we must know where our Java root directory is, and here we can check our current Java root directory under that directory through the PWD command.

Here we see our Java root directory, this is the path we choose, in fact, the equivalent of replication. Here's our final step. Configure the environment variable, and here are two lines that we can take care of. It's much simpler than Windows. Let's go back to the current user's home directory and use the CD. Then edit our. bashrc file. Add the following two lines.

At this point, our Java configuration has been completed, the next is the moment we verify, before the validation, we also need to execute a command, the reason for executing this command is because we have added two lines of command in the file just now, the system will automatically take effect, the answer is no, So here we need to manually make the two lines we just joined take effect.

After the execution of the above command, the order just joined has come into effect. Let's verify that Java is configured successfully, verify that the success is the same as the one we had in front of Windows, and enter java-version for verification.

This allows us to complete the configuration of Java and then we can configure it in the tool.

If you have any questions, you can contact me by the following way.

The most detailed Java environment building for Javaweb Development (Mac 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.