开发环境:
jdk: jdk-8u281-windows-x64.exe
ideaIU: ideaIU-2021.1.3.win.zip
tomcat: apache-tomcat-8.5.9-windows-x64.zip
maven: apache-maven-3.8.3-bin.zip
![](https://img-blog.csdnimg.cn/img_convert/4b2c3b109c244d4f630dfecc9752b719.png)
在d盘创建一个文件夹 dev
以下所有的环境 都安装在指定目录 dev
一、IDEA安装
1.1 jdk安装与配置
安装 jdk-8u281-windows-x64.exe (JDK 和JRE)
双击 .exe 可执行文件 点击下一步
![](https://img-blog.csdnimg.cn/img_convert/8d85b240cb8a6d75d8683638e5986526.png)
自定义 安装路径 D:\dev\Java\jdk1.8.0_281\ 安装jdk
![](https://img-blog.csdnimg.cn/img_convert/3159683d449ecd14c4f1ca8898994341.png)
点击下一步
![](https://img-blog.csdnimg.cn/img_convert/1936e93c8603844455b388b17ae9f93c.png)
自定义jre安装目录(D:\dev\Java\jre1.8.0_281) 点击下一步 安装jre
![](https://img-blog.csdnimg.cn/img_convert/4d9ec57cadb8a49613daa0a61aff0fe7.png)
直接点击关闭 jdk安装完成
![](https://img-blog.csdnimg.cn/img_convert/2b039ab46d91ecb5354e16cabc4db42a.png)
配置jdk环境变量 D:\dev\Java\jdk1.8.0_281\bin
此电脑-->单机右键-->属性-->高级系统设置
![](https://img-blog.csdnimg.cn/img_convert/d17e140f8695261a41e0cba0ac253c99.png)
点击高级系统设置 --》环境变量
![](https://img-blog.csdnimg.cn/img_convert/db0850075fe78aecedec0eda7084055d.png)
1.新建一个系统变量 变量名: JAVA_HOME 变量值: D:\dev\Java\jdk1.8.0_281
2.在path中田间 JAVA_HOME 为了引用 %JAVA_HOME%\bin
新建系统变量
![](https://img-blog.csdnimg.cn/img_convert/257450943475ac5c7d41e340288c603d.png)
在path中 引用系统变量
![](https://img-blog.csdnimg.cn/img_convert/5d5c323e5e6cf5176820eaf72b42b841.png)
![](https://img-blog.csdnimg.cn/img_convert/d0c23e2dac1d7bd416324ac72909cefd.png)
验证jdk是否安装成功
win+R 打开命令行 输入 cmd
![](https://img-blog.csdnimg.cn/img_convert/7868b3ab0128f408e47a987be2b087c5.png)
输入 java -version 出现如下图所示 java的版本
![](https://img-blog.csdnimg.cn/img_convert/59bc21cf58d2db482bf99f39299f5398.png)
1.2 ideaIU安装与配置
安装idea
1.将ideaIU-2021.1.3.win.zip 复制到 D:\dev 目录下
2.将该压缩包解压到 D:\dev 目录下
![](https://img-blog.csdnimg.cn/img_convert/921f0e6e706bb0ffd849d94c985a8bbf.png)
进入 D:\dev\ideaIU-2021.1.3.win\bin 目录找到 idea64.exe
idea64.exe单机右键 --->发送到-->桌面快捷方式
![1676855041948](00 Java环境的搭建和配置.assets/1676855041948.png)
![](https://img-blog.csdnimg.cn/img_convert/8fb4e503f5ac161ff60898234f87fcb2.png)
桌面生成一个idea 图标
![](https://img-blog.csdnimg.cn/img_convert/0f14e9ed27358897dd74a3b5512e6985.png)
![](https://img-blog.csdnimg.cn/img_convert/5b2d615bb1dcd475e79630ce864094e1.png)
![](https://img-blog.csdnimg.cn/img_convert/25ee404174805b7d036428b8c8400f52.png)
![](https://img-blog.csdnimg.cn/img_convert/4805a6707693119d70023f9eb9778547.png)
安装 ide-eval-resetter.zip 插件
(ide-eval-resetter.zip 永久免费使用30天)
ide-eval-resetter.zip 不需要解压 将该压缩包放到 d盘根目录下
![](https://img-blog.csdnimg.cn/img_convert/9db1b8c9029cf291ff1d6e853ac3b1a0.png)
![](https://img-blog.csdnimg.cn/img_convert/6bacb1544504a49d415a8994913398b8.png)
安装汉化插件 输入chinese
![](https://img-blog.csdnimg.cn/img_convert/1c4e815eb80a3e9cc802beebc7f9f456.png)
二、maven的安装与配置
在dev下新建两个目录 1.maven(开发环境) 2.mavenRepo(本地仓库)
![](https://img-blog.csdnimg.cn/img_convert/ef5d59da2732054d919430d1e20d63d5.png)
2.1 安装maven
将压缩包 解压到如下目录 D:\dev\maven\apache-maven-3.8.3
![](https://img-blog.csdnimg.cn/img_convert/1637840ca27c533e0af04e55f7bc5ca9.png)
修改配置文件 settings.xml
D:\dev\maven\apache-maven-3.8.3\conf\settings.xml
指定本地仓库(jar包) 存放路径 D:\dev\mavenRepo
将中央仓库指定为阿里云(从国内服务器下载jar包)
<!-- localRepository
| The path to the local repository maven will use to store artifacts.
|
| Default: ${user.home}/.m2/repository
<localRepository>/path/to/local/repo</localRepository>
-->
<!--指定本地仓库(jar包) 存放路径 D:\dev\mavenRepo-->
<localRepository>D:/dev/mavenRepo</localRepository>
2.将中央仓库指定为阿里云 mirrors 镜像
<mirrors>
<!-- mirror
| Specifies a repository mirror site to use instead of a given repository. The repository that
| this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used
| for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
|
<mirror>
<id>mirrorId</id>
<mirrorOf>repositoryId</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://my.repository.com/repo/path</url>
</mirror>
-->
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
<!--
<mirror>
<id>maven-default-http-blocker</id>
<mirrorOf>external:http:*</mirrorOf>
<name>Pseudo repository to mirror external repositories initially using HTTP. </name>
<url>http://0.0.0.0/</url>
<blocked>true</blocked>
</mirror>
-->
</mirrors>
2.2 配置环境变量
要先安装jdk
配置方式和Jdk环境变量配置方式一样
1.新建系统变量 变量名:MAVEN_HOME 变量值:D:\dev\maven\apache-maven-3.8.3
2.在path中 引用环境变量 MAVEN_HOME
新建 %MAVEN_HOME%\bin
系统变量 MAVEN_HOME
![](https://img-blog.csdnimg.cn/img_convert/754c76ba0792eda74e8120ac4ffedff2.png)
path 引用系统变量 MAVEN_HOME
![1676856930441](00 Java环境的搭建和配置.assets/1676856930441.png)
![](https://img-blog.csdnimg.cn/img_convert/228b3559cfa896d778048d7ec3da1ee2.png)
测试maven是否安装成功
进入命令行(win+R 输入cmd)
输入 mvn -v 则说明maven配置成功
![1676857093303](00 Java环境的搭建和配置.assets/1676857093303.png)
![](https://img-blog.csdnimg.cn/img_convert/8f94887d233d366e11e63d44a6be6806.png)
三、配置应用服务器tomcat
在dev下创建一个目录tomcat 将绿色版本的tomcat复制到该目录下即可
![](https://img-blog.csdnimg.cn/img_convert/84f6829b4d952ae6c8e8eedb31fbebd0.png)
在idea中添加 应用服务器 如下图所示
![](https://img-blog.csdnimg.cn/img_convert/5fe6ad3f6a015b672c424ea3f221b52c.png)
之后选择tomcat的解压路径即可
![](https://img-blog.csdnimg.cn/img_convert/23ac639f63d8b0888fcd5cb4bb074833.png)
![](https://img-blog.csdnimg.cn/img_convert/5d97642d51e8cbf30412b8e03181a168.png)
之后点击确定即可
四、使用IDEA创建普通Java项目
一定要有网
将 D:\dev\maven\apache-maven-3.8.3\conf\settings.xml
settings.xml 复制到 C:\Users\lenovo.m2 目录下
以下步骤是在IDEA构建普通java项目
![](https://img-blog.csdnimg.cn/img_convert/9a462ac405b5439d5bfa91878190c967.png)