Java development environment to build learning -Day1-

Introduction to Java

Java is a programming language developed by Sun's James Gosling invention, then Sun's acquisition by Oracle, which means that the Java language is now part of Oracle Corporation.
Java is divided into three systems:

  • Java SE: Java Standard Edition
  • Java EE: Java Enterprise Edition
  • Java ME: Java Micro Edition

Relationship between the three is: Java SE is included in Java EE, Java SE includes Java ME

Important terms

  • JDK: Java Development Kit, Java language Software Development Kit
  • JRE: Java Runtime Environment, Java Runtime Environment
  • JVM: Java Virtual Machine, Java Virtual Machine

JDK includes JRE, Java source code is compiled into bytecode need JDK, JRE includes the Java virtual machine inside, you can run the compiled byte code.

Java development environment configuration

Download and install JDK

Operating environment: win10

Go Orange official website to download JDK13, choose their own operating system based on the corresponding version, you need to accept the License to download the license.

Official website to download slowly, can be from Huawei mirror source JDK download.

After downloading the option can be installed by default.

Configuration environment variable

Configuring the JAVA_HOME environment variable, whose value JDK installation path

the JAVA_HOME bin directory added to the system variable Path

Open a command line window, enter the command

java -version

If you see the following output, the JDK successful installation and configuration.

If Tip: Java is not an internal or external command, operable program or batch file. You need to check the configuration JAVA_HOME and Path environment variable is correct.

First Java program

  • Open a text editor, recommend notepad ++, create a new file HelloWorld.java, enter the following code:
public class HelloWorld{
    public static void main(String[] args){
        System.out.println("Hello world.");
    }
}
  • 在HelloWorld.java的所在目录下执行命令,javac就是将Java源码编译成字节码
javac   HelloWorld.java 

如果上述代码每月语法错误时,同级目录下会生成HelloWorld.class文件

  • 运行程序
java  HelloWorld

使用IDE

IDE,Integrated Development Environment,是集成开发环境的简称。IDE可以方便地编写与运行程序,提升开发效率,IDEA是公认的最好用的Java IDE之一,在IDEA官网上可以下载,下载后安装即可,其分为两个版本,社区版和终极版,后者是收费的,可以免费使用30天。

Guess you like

Origin www.cnblogs.com/webDepOfQWS/p/12129196.html