Java language portal - the first HelloWorld program

1. official website to download Jdk

  Here is the official website to download URL: https://www.oracle.com/technetwork/java/javase/downloads  .

  1.1 After opening the following screen appears:

  

Select the corresponding version 1.2: Pick Jdk8 version.

The latest is not necessarily the best, stability is king.

  

 

 

 

2. Install

2.1 Double-click the installation package opens, click Next.

 

2.2 Click Change route path, and then click Next.

 

 

 

 2.3 Click OK

 

 

 2.4 installation is complete, closed

 

 

 

3. Right-click My Computer environment configuration -> Properties -> Advanced System Settings.

A total of three steps environment configuration

3.1 JAVA_HOME: JDK installation directory configuration  

The top is a user variable, below is a system variable, said here about the difference between them: a user variable only for the current computer user, the system variables for all users.

Here to system variables, for example.

 

Find JAVA_HOME variable, not the new.

 

 

 

 3.2 Configuration PATH: Configure JDK installation bin (command) directory

 Find the PATH variable, double-click New to enter 

 

3.3 Configuring the CLASSPATH variable: 

" . Means the current directory" (.class files directory: directory java file)

 

 

 Here, the entire jdk installation configuration is over.

If unsure, you can test:

Open window + R -> Input cmd -> Open command line input java

 

 

 Enter javac  

 

 

 Enter java -version (java behind spaces) see the version number

 

 

 

 4. The first program HelloWorld

4.1 Create a text file named HelloWorld.java .java ending in the D drive

Double-click to open the file, enter the following  

public class HelloWorld{
    public static void main(String[] args){
         System.out.println("Hello World");
    }  

 

 

 

 

 

 

 CTRL+s保存  

4.2在当前文件所在目录下输入cmd,进入命令行

 

 

 输入命令:编译:javac HelloWorld.java   

      运行:java HelloWorld

 

 到这里 第一个HelloWorld程序开发就结束了  

第一次写博客  还请大家提出宝贵意见

    

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Guess you like

Origin www.cnblogs.com/caozyblogs/p/caozyblogs.html