# JDK + IntelliJ IDEA 环境搭建

## 1. 安装 Java JDK

&#x20;[打开Oracle Java官网](https://www.oracle.com/java/)

![](https://3876120153-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MeAUhQfs4IbJtX3pwu_%2F-MeXjT_fHi5c73iTIbio%2F-MeXnrOQ8RZNsGbY5f9q%2FORACLE.png?alt=media\&token=3e11721c-4e74-45bd-a4fe-9796dbb1ace3)

拉到下面选择 Download Java now

![](https://3876120153-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MeAUhQfs4IbJtX3pwu_%2F-MeXjT_fHi5c73iTIbio%2F-MeXoUk6jl_9Q3Jm0dQo%2FJava%20download%20page.png?alt=media\&token=c19c1572-5c01-4854-9fbe-67740c183176)

选择 JDK 版本，这里我们选择 Java SE 8

![](https://3876120153-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MeAUhQfs4IbJtX3pwu_%2F-MeXjT_fHi5c73iTIbio%2F-MeXpp77Sth0o3s9rwrV%2FJava%20SE%208.png?alt=media\&token=52540350-9c1c-42dc-a415-c6a08c7a960b)

点击 JDK Download

下面会出现很多下载版本，这里我们选择最后一个，也就是Windows x64 版本

![](https://3876120153-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MeAUhQfs4IbJtX3pwu_%2F-MeXjT_fHi5c73iTIbio%2F-MeXqW0dWP-PKfDUsX_t%2FJDK%20version.png?alt=media\&token=874a813b-f1ae-4b31-9dcb-d73b94f53acd)

点击右边的下载链接后，需要注册Oracle账户，注册好了正常下载即可。

![](https://3876120153-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MeAUhQfs4IbJtX3pwu_%2F-MeXjT_fHi5c73iTIbio%2F-MeXqgN-xknjrvU4fnvp%2FORACLE%20sign%20in.png?alt=media\&token=42720b51-943e-4970-bafa-3f8df6173f21)

下载好安装包以后打开，一路默认安装即可

![](https://3876120153-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MeAUhQfs4IbJtX3pwu_%2F-MeXjT_fHi5c73iTIbio%2F-MeXsXA4cJ5_84nC1RRH%2FJDK%20install.png?alt=media\&token=9beb7e19-beda-48e7-b4c5-c2b49bd73d4e)

为了验证是否安装成功，我们可以打开win 10的cmd命令行

输入

```bash
java -version
```

若能显示出java的版本号，说明安装成功

![](https://3876120153-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MeAUhQfs4IbJtX3pwu_%2F-MeXjT_fHi5c73iTIbio%2F-MeXsuUP1eCBz26lECRc%2FJava%20cmd.png?alt=media\&token=8f44b959-c393-4537-beca-d93b6cda8cd4)

Java 默认安装到 C:\Program Files\Java 目录下

![](https://3876120153-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MeAUhQfs4IbJtX3pwu_%2F-MeXjT_fHi5c73iTIbio%2F-MeXt5ZB1Y9L4RqH8q5w%2FJava%20directory.png?alt=media\&token=3416c53d-c71d-40a0-9386-b4f29f94624b)

## 2. 配置环境变量

打开控制面板，点击 系统和安全， 点击 系统，点击 高级系统设置，点击 环境变量， 点击 当前用户的用户变量 里面的Path , 点击编辑。

![](https://3876120153-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MeAUhQfs4IbJtX3pwu_%2F-MeXjT_fHi5c73iTIbio%2F-MeXvuwmZMJFl2_Z7wzM%2Fenvirn%20path%200.png?alt=media\&token=1705c654-130e-42e9-88e7-3688b0631602)

进去后，点击新建，将 java 可执行文件的目录 加进去， 目录默认是在 C:\Program Files\Java\jdk1.8.0\_162\bin。

![](https://3876120153-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MeAUhQfs4IbJtX3pwu_%2F-MeXjT_fHi5c73iTIbio%2F-MeXw2mrvo8aJ0dJO5f_%2Fenvirn%20path%201.png?alt=media\&token=0a7fe702-d477-40dd-a946-79b49c7391aa)

然后点击确定，环境变量配置完成。

## 2. 下载安装 IntelliJ IDEA

打开 [IntelliJ IDEA 下载官网 ](https://www.jetbrains.com/idea/download/#section=windows)

![](https://3876120153-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MeAUhQfs4IbJtX3pwu_%2F-MeXwTg9_Wl9AJZPGKP6%2F-MeXxsm7Cf1O-zaTXgqF%2FIDEA%20download.png?alt=media\&token=b8ca24dd-a78b-43e7-81c6-665e9b953a04)

推荐下载 Ultimate 版本

下载后打开安装文件

![](https://3876120153-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MeAUhQfs4IbJtX3pwu_%2F-MeXwTg9_Wl9AJZPGKP6%2F-MeXzWcJxEI4N6ErAj8z%2FIDEA%20setup%200.png?alt=media\&token=8b95afee-49b7-4bc0-b48e-c7002e5be8c2)

点击 Next

![](https://3876120153-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MeAUhQfs4IbJtX3pwu_%2F-MeXwTg9_Wl9AJZPGKP6%2F-MeXzb9ZLPmUXqHOuHKD%2FIDEA%20setup%201.png?alt=media\&token=07f71615-5506-4f10-8839-d3c3e08cd457)

选择安装路径, 点击 Next

![](https://3876120153-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MeAUhQfs4IbJtX3pwu_%2F-MeXwTg9_Wl9AJZPGKP6%2F-MeY-21cWtfZt06scWzB%2FIDEA%20setup%202.png?alt=media\&token=d1ec4910-3da8-4962-941c-2fc9f0cc5c3f)

勾选 64-bit launcher, .java 和 Add launchers dir to the PATH。

![](https://3876120153-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MeAUhQfs4IbJtX3pwu_%2F-MeXwTg9_Wl9AJZPGKP6%2F-MeY0106o4UhI0C6aPJV%2FIDEA%20setup%203.png?alt=media\&token=92c4760e-c4df-4bbe-9642-08fd90fbdc55)

点击 Install 开始安装

![](https://3876120153-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MeAUhQfs4IbJtX3pwu_%2F-MeXwTg9_Wl9AJZPGKP6%2F-MeY0sELc4zTekSecNp4%2FIDEA%20setup%204.png?alt=media\&token=30691d7e-720b-4723-9f38-331db6d0f985)

等待安装

![](https://3876120153-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MeAUhQfs4IbJtX3pwu_%2F-MeXwTg9_Wl9AJZPGKP6%2F-MeY0znn5alaFXJGDNE-%2FIDEA%20setup%205.png?alt=media\&token=fcda972e-fc86-4cc6-bf98-1cec0d677a9b)

完成安装后，需要重启。

重启以后，桌面打开 IntelliJ IDEA 图标，启动 IntelliJ IDEA

![](https://3876120153-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MeAUhQfs4IbJtX3pwu_%2F-MeXwTg9_Wl9AJZPGKP6%2F-MeY2b2Pjkz5xXttaF17%2FIDEA%20boot.png?alt=media\&token=57e965c9-f968-4ea2-8a02-06f38bdabb3a)

随后需要激活，可以选择学生邮箱注册一个 JetBrains 账户, 也可以试用30天。

![](https://3876120153-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MeAUhQfs4IbJtX3pwu_%2F-MeXwTg9_Wl9AJZPGKP6%2F-MeY1w9r8p0El7BCckpT%2FIDEA%20license.png?alt=media\&token=731de03d-0ca4-47e1-ac69-fedf12ddf970)

激活后进入 IntelliJ IDEA 欢迎页面

![](https://3876120153-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MeAUhQfs4IbJtX3pwu_%2F-MeXwTg9_Wl9AJZPGKP6%2F-MeY2rpI5xH18fd8nnED%2FIDEA%20welcome.png?alt=media\&token=746df800-93d3-49c0-8112-05eb22b6e0de)

至此 完成了 IntelliJ IDEA 的安装。
