java configuration and installation (see the knowledge of classroom video notes)

The first step: extract the java installation package
himself java archive left in the computer disk D \ java folder
Step Two: Configure environment variables
Desktop Click on this computer, mouse put this computer, right-click Properties, click Advanced System Settings, click the environment variables
in the path above the midpoint of user input variables into java folder location where; I would enter: D: \ java
New below system variables at:
variable name: JAVA_HOME
variable value: D: \ java \ jdk1.8.0 _102
the Java Home configuration end;
followed configuration Class path;
system variables click New:
variable name: CLASSPATH
variable values:;.% JAVA_HOME% \ lib \ dt.jar;% JAVA_HOME% \ lib \ tools.jar
click OK
to configure the system path variables:
to find the path, double-click, click go after the New
input:% JAVA_HOME% \ bin
and then create and enter:% JAVA_HOME% \ jre \ bin
last: click OK, OK

The above configuration environment must be placed in English state input in the job.

Dos window into the operation: Shortcuts: Windows key + R key, type cmd and click OK.

When entering Windows, Dos command window
enter: java -version
My Computer reality:
'the Java' is not an internal command

This is supposed to do?
I think there should be a variable relationship with the user,
and therefore re-open the window environment variables:
user variables of the environment variable, double-click into the path of the
add: D: \ java
OK, OK, OK three times to determine the operational oh

Dos simultaneously into the window, enter java -version
displayed as shown:

Successful installation
Step 3: Create java files
in a folder at the location of the D drive, click on the button above to view the file extensions tick,
New After txt file, there will be extension of the text file, name the file and save Test.java.
Right Use Notepad to open the file, enter the program:

public class Test{
        public static void main(String[] args){
                System.out.print("hello world");
        }
}

Next to the Public Test procedure above statement and file name must be consistent.
Oh, the English input method input state.
After the completion of the input storage, Ctrl + S Close

Step four: compile java program

  1. The write java code to the file extension of .java
  2. Java files compiled by the javac command
  3. That runs the generated class file via the java command.

Dos window into the
post because my java files in D drive, so it needs to enter the window, enter the command: D:
enter the D disk, enter: javac Test.java
compiler
How do I know whether to compile complete it?
Observe whether the directory folder where the file has a java CLASS files Test.class
continue typing:
java the Test
Be sure to look carefully input
after huiche output:
the Hello world

The first java program success.
Reward yourself Meme da!

Published 14 original articles · won praise 5 · Views 2397

Guess you like

Origin blog.csdn.net/m0_37536859/article/details/103590051