Diagram of Java runtime environment setup under Windows7

  • 2020-04-01 03:16:46
  • OfStack

Step 1: (link: http://www.oracle.com/technetwork/java/javase/downloads/index.html)

Address: (link: http://www.amazon.cn/? _encoding = UTF8 & camp = 536 & creative = 3200 & linkCode = ur2 & tag = guavar-23

Click the "Java Download" button.

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201404/201404220844591.png ">

Select the "Accept License Agreement" radio button.

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201404/201404220844592.png ">

Let's take the Windows 64-bit operating system as an example and download the Windows X64 version of the JDK.
Click "JDK -8u5-windows-x64.exe" to download directly.

Step 2: install

Double click to run installation

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201404/201404220844593.png ">

Click the next button.

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201404/201404220844594.png ">

Click the change button to select the JDK installation directory. (personal suggestion not modified)

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201404/201404220845005.png ">

Click the next button to install...

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201404/201404220845006.png ">

Click the change button to select the installation directory for the jre. (personal suggestion not modified)

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201404/201404220845007.png ">
Click the next button to install...

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201404/201404220845008.png ">

Installation complete.

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201404/201404220845009.png ">

Attachment: JDK directory structure:

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201404/2014042208450010.png ">

The JDK \ bin \

This includes compilers, interpreters, and some basic tools

The JDK \ include \

Is the Win32 subdirectory, including the local method file

The JDK \ jre

Is the root directory of the Java program running environment

The JDK \ jre \ bin

Includes executable and dynamic link library files for the platform runtime tools and class libraries

The JDK \ jre \ lib

Includes the Java runtime code base, default installation files, and so on

The JDK \ lib

Includes class library files

The JDK \ SRC. Zip

Source code archive

 

Step 3: setup

Definition:

An environment variable is an object with a specific name that contains information that one or more applications will use.
        For example, path, when a system is required to run a program without telling it the full path to the program, the system should go to the path specified in the path in addition to looking for the program under the current directory. The user sets the environment variables to run the process better.

Right-click on my computer -- > Click the properties option.

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201404/2014042208450011.jpg ">

Click the advanced system Settings option.

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201404/2014042208450012.jpg ">

Select the advanced TAB. Click the environment variables button.

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201404/2014042208450013.jpg ">

 

Click the new button.

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201404/2014042208450014.jpg ">

 

Note: system environment variables affect all users, while user environment variables affect only the current user.

Fill in the variable name and value.

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201404/2014042208450015.jpg ">

(1) the JAVA_HOME

  Is the JDK path in the Java installation path. (make sure that JCreator, Eclipse, MyEclipse and other software works properly)

  For example: C:\Program Files\Java\jdk1.8.0_05

 

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201404/2014042208450016.png ">

(2) the PATH

The bin folder in the JDK installation directory contains the Java compiler (javac.exe), the Java interpreter (java.exe), and in order to use the compiler and interpreter in any directory, you should set the Path in the system features.

For example: C:\Program Files\Java\jdk1.8.0_05\bin
%JAVA_HOME%\bin   Where "%JAVA_HOME%" is the path where the JDK was just set. And you don't need to change here when the JDK path changes.)

note : if there are more than one variable value, use ";" Space (not including quotes)

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201404/2014042208450117.png ">

(3) the CLASSPATH

The lib folder in the JDK installation path contains the Java class library files that the Java application needs to run.

For example:   .; C: \ Program Files \ Java \ (x86) jdk1.7.0 _03 \ lib
Or written. The % JAVA_HOME % \ lib  "%JAVA_HOME%" means the same as above.

note : be sure to add "; "at the beginning. (not including quotes)

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201404/2014042208450118.png ">

Press the key combination "Win" + "R" to bring up the run window, enter CMD in the "open" text box, and click ok.

Pop up the command prompt interface, type Java at the cursor, and press enter.

 

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201404/2014042208450119.png ">

After entering "Java," press enter (or javac), and if help information for Java is displayed, the environment variable is set successfully.

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201404/2014042208450120.png ">

 

The appendix

The main programs in the JDK:

Javac

Java compiler, which converts Java source code into bytecode.

Java

Java interpreter, which executes the Java application bytecode directly from the class file.

Appletviewer

Applet browser, a Java browser that executes Java applet on HTML files.

The Javadoc

Generate HTML documents based on Java source code and specification statements.

Jdb

Java debugger that executes programs line by line, sets breakpoints, and checks variables.

Javah

Generates a C procedure that can invoke a Java procedure, or creates a header file for a C procedure that can be invoked by a Java program.

Javap

Java disassembler that displays the accessible functionality and data in the compiled class file, along with the meaning of the byte code.

 

Development environment built!!

 

 


Related articles: