Article directory
1. Reproduce the error
Today we are going to test camunda
the workflow, so create a new spring boot camunda
project, as shown in the following figure:
But when starting, the following error is reported:
2. Analysis errors
Error description: Error:java: 无效的源发行版: 12
.
When using idea
the running project, if an error is reported: Invalid source distribution: XXX.
This is because the version numbers of the version idea
set jdk
and the version of the project being run do not match.jdk
If the project jdk
version is 12
and idea
the environment setting jdk
version is 1.8, an error will be reported.
3. Fix bugs
- Click
idea
inProject Structure
, or useCtrl + Alt + Shitf + S
shortcut keys, as shown in the figure below:
- Check out the version number
Project
injdk
.
jdk
The version number is 8
, there is no problem here and no modification is required, as shown in the following figure:
- Viewing .
Modules
_Dependencies
Here , Module SDK
there is 8
no problem and no modification is required, as shown in the following figure:
- Viewing .
Modules
_Source
Here language level
it is 12
, as shown below:
Change this to 8
, as shown in the following figure:
- At the same time, the modification
pom.xml
isjava.version
as8
shown in the following code
<properties>
<java.version>8</java.version>
</properties>
javaCompiler
Those that are being modifiedTarget bytecode version
must correspond to your ownjdk
version (我的jdk版本是8
).
Click one 【File】-> 【Settings】-> 【Build, Execution, Deployment】-> 【Compiler】-> 【Java Compiler】
by one to modify as shown in the figure below.
- Restart the project to start successfully, as shown in the following figure:
4. Supplementary Questions
If you have a problem like this:
Error:(3, 32) java: 无法访问org.springframework.boot.SpringApplication
错误的类文件: /C:/Users/zxy/.m2/repository/org/springframework/boot/spring-boot/3.1.0/spring-boot-3.1.0.jar!/org/springframework/boot/SpringApplication.class
类文件具有错误的版本 61.0, 应为 52.0
请删除该文件或确保该文件位于正确的类路径子目录中。
You can refer to the blog post: Solve the inability to access org.springframework.boot.SpringApplication