SpringBoot修改子模块Module的jdk版本的方法 附修改原因
作者:夜中听雪 时间:2023-07-23 21:05:20
一、项目目录
即一个空项目里,有两个springboot的Module。
当需要修改kuangshen-es-api这个Module的jdk版本时,可以修改以下内容。
二、修改以下内容
1、pom.xml
修改kuangshen-es-api这个Module的pom.xml文件:
<properties>
<java.version>1.8</java.version>
</properties>
2、Project Structure
File->Project Structure
3、Settings
File->Settings
三、运行时看到jdk版本
四、修改原因
1、不需要修改File->Project Structure->Project吗?向下方这样。
不需要,两个框框上方的英文小字已经说明了原因。两段英文小字和翻译如下:
Project SDK:
This SDK is default for all project modules.
A module specific SDK can be configured for each of the modules as required.
项目SDK(SDK:Software Development Kit,软件开发工具包):
对于所有项目模块,这个SDK都是默认的。
可以根据需要为每个模块配置特定于模块的SDK。
Project language level:
This language level is default for all project modules.
A module specific language level can be configured for each of the modules as required.
项目语言级别:
对于所有项目模块,此语言级别都是默认的。
可以根据需要为每个模块配置模块特定的语言级别。
就是说,File->Project Structure->Modules->选择要配置的Module->在Dependencies里配置该Module的Module SDK,在Sources里配置该Module的Language Level。 这样,就单独为这个Module配置了特定的Module SDK和Language Level,那么就会忽略掉项目Project上配置的这两项。所以,File->Project Structure->Project上的这两项不需要配置。
2、为什么要修改File->Settings->Java Compiler?
编译时会用到,编译把.java文件变为.class文件。保存代码时,不会编译,但点run按钮运行时会。如果不修改Java Compiler,点击run运行时,由于执行编译,可能会报如下错误。
解决方法:
IntelliJ IDEA报错Error:java: Compilation failed: internal java compiler error的解决办法
https://www.jb51.net/article/149422.htm
来源:https://blog.csdn.net/wpw2000/article/details/115378675
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Java性能调优概述
IntelliJ IDEA 2020.2正式发布,两点多多总能助你提效
![](https://img.aspxhome.com/file/2023/2/58082_0s.jpg)
Maven依赖作用域和依赖传递的使用
![](https://img.aspxhome.com/file/2023/4/129104_0s.png)
c# 判断指定文件是否存在的简单实现
C# 如何在MVC3中取消备用控制器的选择
部署Java在服务器端的EJB组件的方法
Java零基础入门数组
![](https://img.aspxhome.com/file/2023/0/113500_0s.png)
Mybatis实现自定义类型转换器TypeHandler的方法
![](https://img.aspxhome.com/file/2023/9/80279_0s.png)
Java并发编程预防死锁过程详解
Android键盘输入语言设置默认打开myanmar缅甸语的步骤
C#生成EMF矢量图形文件示例详解
![](https://img.aspxhome.com/file/2023/9/79129_0s.jpg)
有关tomcat内存溢出的完美解决方法
Java基础知识之StringWriter流的使用
C#中时间类的使用方法详解
Java 详解垃圾回收与对象生命周期
深入理解Java虚拟机体系结构
![](https://img.aspxhome.com/file/2023/6/62366_0s.png)
一篇超详细的SpringBoot整合MybatisPlus的文章
![](https://img.aspxhome.com/file/2023/9/116119_0s.png)
Java实现企业员工管理系统
Android自定义渐变式炫酷ListView下拉刷新动画
![](https://img.aspxhome.com/file/2023/3/138983_0s.gif)
C#开发Windows服务实例之实现禁止QQ运行
![](https://img.aspxhome.com/file/2023/6/83296_0s.jpg)