vscode + jdk8 +maven 开发配置
开发环境 win10
1. 下载 vscode + zulu openjdk 8 + maven
2. openjdk8 和maven 解压放到 d:\java 下,这里看你们自己喜好。我的默认放在java文件夹下
解压只要里面bin上面一级的文件夹复制到d:\java下面就好
jdk ===> d:\java\jdk
maven ===> d:\java\maven
3. 添加环境变量:
JAVA_HOME => d:\java\jdk
MAVEN_HOME =>d:\java\maven
PATH => %JAVA_HOME%\bin;%JAVA_HOME%\jre\bin;%MAVEN_HOME%\bin
CLASSPATH => .; %JAVA_HOME%\bin\dt.jar;%JAVA_HOME%\bin\tools.jar
4. vscode安装插件
Java Extension Pack
Spring Boot Extension Pack
5.打开vscode的settings.json添加:
"java.home": "D:/java/jdk/",
"maven.executable.path": "D:/java/maven/bin/mvn.cmd",
"java.configuration.maven.userSettings": "D:/java/maven/conf/settings.xml",
"maven.terminal.customEnv": [
{
"environmentVariable": "JAVA_HOME",
"value": "D:/java/jdk/"
}
],
6. maven 下载很慢,改国内镜像 和 设置repo
用vscode 打开D:\java\maven\conf\settings.xml
添加 <localRepository>D:\java\maven\repo</localRepository>
在添加一条阿里云镜像
<mirrors>
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
最后这样,你可以开始你的java开发玩耍了