IDEA配置JDK

目录

一、jdk安装以及版本

1、安装jdk17

2、确保系统环境变量配置是jdk17

二、maven版本配置

1、修改settings.xml配置文件

三、IDEA配置JDK

1、为当前项目配置jdk

2、查看项目JDK版本是否正确

3、全局配置JDK

四、setting其他检查

[1、 Runner](#1、 Runner)

[2、Java Compiler](#2、Java Compiler)


前言:SpringBoot项目开发jdk配置,本文JDK17为例

一、jdk安装以及版本

1、安装jdk17

2、确保系统环境变量配置是jdk17

复制代码
# cmd 输入
java -version

二、maven版本配置

1、修改settings.xml配置文件

复制代码
	<!-- ${MAVEN_HOME}/conf/settings.xml 文件添加如下profile配置,建立的java项目默认使用java 17 -->
	
    <profile>
        <id>jdk-17</id>
        <activation>
            <activeByDefault>true</activeByDefault>
            <jdk>17</jdk>
        </activation>
        <properties>
            <maven.compiler.source>17</maven.compiler.source>
            <maven.compiler.target>17</maven.compiler.target>
            <maven.compiler.compilerVersion>17</maven.compiler.compilerVersion>
        </properties>
    </profile>  
	<!--
	    <profile>
        <id>jdk-1.8</id>
        <activation>
            <activeByDefault>true</activeByDefault>
            <jdk>1.8</jdk>
        </activation>
        <properties>
            <maven.compiler.source>1.8</maven.compiler.source>
            <maven.compiler.target>1.8</maven.compiler.target>
            <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
        </properties>
    </profile>
-->
  </profiles>

三、IDEA配置JDK

1、为当前项目配置jdk

依次点击菜单栏 File -> Project Structrue

点击 SDKs -> + -> Add JDK,开始添加新的 JDK,选择新的 JDK 安装目录,这里新添加的 JDK 17, 然后点击【OK】按钮 :(如果存在略过)

2、查看项目JDK版本是否正确

依次点击菜单栏 File -> Project Structrue

3、全局配置JDK

点击 File -> New Projects Setup -> Structure -> Project 下的 SDK 选项,将其更改为你最常用的 JDK 版本

四、setting其他检查

1、 Runner

2、Java Compiler

相关推荐
坚定学代码13 分钟前
static在c++中的使用
开发语言·c++
Json____36 分钟前
从零构建家政服务平台:一套全栈架构如何打通管理端与移动端-java-springboot
java·spring boot·后端·架构·毕设·wwwoop.com
云雀衔光1 小时前
Java Spring AI MCP:在 Spring 里把 AI 接上你的业务系统
java·开发语言·人工智能·后端·测试工具·spring
重生之小比特1 小时前
【Java SE】数据类型与变量
java·开发语言·python
苏渡苇1 小时前
Spring Insight 里如何对 Span 进行清洗
java·spring boot·后端·spring·系统监控
find1star1 小时前
LeetCode 54:螺旋矩阵——用四个边界模拟矩阵收缩
java·算法·leetcode·边缘计算·学习方法
Yeniden1 小时前
Java 后端从零到企业级:第1篇 Java 基础语法——变量、数据类型与运算符
java·开发语言·apache
邪修king1 小时前
Linux系统篇(二十三) 基础 IO:从“文件”到“文件描述符”,彻底理解重定向
android·java·linux
云雀衔光1 小时前
MCP + 应用生成:让 AI 直接产出可交互的应用
java·人工智能·测试工具·microsoft·交互·ai编程
luj_17681 小时前
罚球线右移破防新策略
c语言·开发语言·网络·经验分享·算法