jdk1.8 Installation and Configuration

jdk1.8 Installation and Configuration

1. Download jdk1.8

Go to the official website to download
the download link - Click is to download

2. Install jdk / jre

Installation of the first esoteric - no brain default

The default installation path to the C drive during installation, do not move him here

All the way to the next step

Install half the time there will be jrethe installation path selection

Here is the next step without brain

And then installed the

3. Set Environment Variables

Because we use the default path, so we configured the environment variables and I also very much the same

jdk路径;

C:\Program Files\Java\jdk1.8.0_201\bin

jre路径

C:\Program Files\Java\jre1.8.0_201\bin
右键【此电脑】
点击【属性】
选择左边的【高级系统配置】
点击下面的【环境变量】

这里我们配置下面的 【系统变量】 上面的【用户变量】就暂时不管了
选择【path】双击
新增我们的的 【jdk路径】【jre路径】

新增完毕后一路确定回来

4. Test

For testing at the command line (cmd)

Enter the java -version
return java version information

Enter the javac -version
return javac version information

The last sentence

Said here about javac javathe role of

javacIt used to compile the code
javato run the code

The so-called 编译is compiled into a .classdocument, will be here after school

for example

Create a .javafile

File name and extension is Hello.java
as follows

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

The current directory, open a command line

Run javac Hello.javacompiled
we can see more than a current directory .classof the file

Run java HelloRun the code
and command line results

Guess you like

Origin www.cnblogs.com/txtnb/p/11275721.html