[Java Tutorial 02] Development environment Building

Source: Internet
Author: User

After a brief introduction to Java in the previous article, I think we all have a preliminary understanding of her! Before stepping into formal learning to use Java, we have a step that we have to do, what is it? There is nothing wrong with the title of this article to build the Java development environment. So let's get into the theme!

Because Java is now on the mainstream platform almost all support, the environment is very similar to the construction, I will take everyone to use more than two systems to do example (Mac can not afford to buy a temporary first not to say ...) )。

First we enter the JDK's official: http://www.oracle.com/technetwork/java/javase/downloads/index.html

Because java9 just out, so we use it to taste early adopters, technology, or more to try more. It should be like this after entering, and then according to their current operating system to select the version to download, click to download the line

Windows installation process

In fact, the installation of the JDK on Windows is very simple, I directly attached to the operation diagram, you can follow the image sequence.

First find the JDK we just downloaded, double-click Run, pop up the installer

Click Next directly

If you do not want to install on the C drive, you can click Change, select the drive letter you want to install, then click Next

Wait until the installation progress bar finishes executing

Just click Next and wait for the progress bar to finish.

After the walk, pop up the installation success prompt, click Close directly.

is not very happy, is not very excited? Don't worry, young man, not yet!!!

Open a Command window, enter java-version to view the version information, and confirm whether the installation was successful.

Environment variable Configuration

If you print out the JDK version information, it means that the installation process was successful!

is not very excited ah, but trouble the old iron excitement first stop ha, so although the installation is successful, but the use of some restrictions, such as you find the Java directory just installed, into the JDK bin directory, such as my C:\Program files\java\ Jdk-9.0.4\bin

Then input cmd in the current window, enter into the DOS window

Enter Javac in the command window and you will find information about how to print out the Javac usage.

But if you enter javac under a DOS window in another directory, you will find that they do not recognize this javac and print the information as shown

Why is he not acquainted with the other directories? Because Javac in the Java\jdk-9.0.4\bin directory exists Javac.exe Ah, is equal to I use my home of things, certainly can use Ah, others home no of course not use! How can you use the contents of the bin directory under other directories? This is what we need to configure a Windows one called environment variables!

Then there must be someone to ask, what is the environment variable ah? Oh, I thought you would ask, can be inquisitive this is a very good habit, I certainly support.

Environment variables (environment variables) are typically used in the operating system to specify the operating system environment of some parameters, such as: temporary folder location and System folder location. An environment variable is an object with a specific name in the operating system that contains the information that one or more applications will use. For example, the PATH environment variable in Windows and DOS operating system, when the system is required to run a program without telling it the full path of the program, in addition to the current directory in the search for this program, but also in path specified in the path to find. The user can run the process better by setting the environment variables.

The above from Baidu ha, look is not very professional look. The popular point is that the environment variable is equivalent to the system or user application settings of some parameters, the specific role of this course and the specific environment variables related. For example, path, is to tell the system, when the system is asked to run a program without telling it the full path of the program, in addition to the current directory under the search for this program, but also to what directories to look for.

What environment variables does Java want to configure? Let's configure it again.

Find My Computer, click the right mouse button, select Properties, pop up the following window

Click Advanced System settings to bring up the following window

Click on the Environment Variables button, pop-up window and click New

Click on the new, this will appear, the variable named "Java_home" (Copy the contents of my quotation marks can be, without quotes, the same as), the variable value, must be the path of their own JDK, such as my installation path is e:java\jdk\, path problems also need to be noted

Next find "CLASSPATH", no words "new"

The variable is named "CLASSPATH" variable value.; %java_home%\lib\dt.jar;%java_home%\lib\tools.jar; "

Find path, edit it, if it is windows7 directly in its original variable value finally added ";%java_home%\bin;%java_home%\jre\bin;", if it is WIN10, click New, respectively, the%java_home%\ Bin and%java_home%\jre\bin are added to the PATH environment variable,

Remember to complete the following points two OK

After setting up, we'll try to see if we can globally use commands such as Javac to verify that the configuration was successful. Directly click on the keyboard win+r, enter cmd, open the Command window, enter our just javac command, enter, there is nothing to find?

The DOS window directly prints out the usage of the javac.  Some people will ask: just when we just installed the time did not also appear? Elder brother, note the path of the red box NO!!! It's not a directory of JDK, it means we can use Java's commands in other directories! If you can't, you can open the DOS window input javac in any directory to verify it. So our Java environment on Windows is built!

Granny I do not help, just take my own, hehe ~

Linux

Cough cough, the above finally put the environment of Windows is finished, read above so a large section of everyone is too give me face!!! This is supposed to explain how to build the development environment on Linux, but after my consideration, I intend to give up this part of the Content editor. Someone must ask: Why don't you write Linux?

Do not be frank, directly with the development of Linux people after all, too few, now Linux is mainly used in our program is written and put up to do server running service. But also do not deny that there are a few people directly choose to use Linux development, some are pure technology, with the Vim editor used to, there is a Linux graphical interface to develop, such a person ... I find it hard to understand, the graphical interface you do not use Windows Linux Ah!

I think many of the people who read this article now are not technically big. So what are we going to do? Wouldn't it be a little too hasty to go without thinking about running?

This is my 10-second self-criticism.

As for Linux, there will certainly be a chance for everyone to get acquainted, more days ~

Reprint Please specify: Stay the bell? [Java Review 02] Development environment Construction

[Java Tutorial 02] Development environment Building

Related Article

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.