jhipster - Jhispter cannot run - Stack Overflow

时间: 2025-01-06 admin 业界

After generating the application using JHipster, I tried to run it, but it failed.The error seems strange.

[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- enforcer:3.5.0:enforce (enforce-versions) @ jhipster-sample-application ---
[INFO] Rule 0: org.apache.maven.enforcer.rules.version.RequireMavenVersion passed
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.607 s
[INFO] Finished at: 2025-01-04T16:19:00+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.5.0:enforce (enforce-versions) on project jhipster-sample-application: 
[ERROR] Rule 1: org.apache.maven.enforcer.rules.version.RequireJavaVersion failed with message:
[ERROR] You are running an incompatible version of Java. JHipster supports JDK 17 to 23.
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] 

However, my Java version is 22.0.2, which should be supported according to the error message. Here is the output of java --version:

java --version
java 22.0.2 2024-07-16
Java(TM) SE Runtime Environment (build 22.0.2+9-70)
Java HotSpot(TM) 64-Bit Server VM (build 22.0.2+9-70, mixed mode, sharing)

I am confused. Can anyone help me with this issue?

After generating the application using JHipster, I tried to run it, but it failed.The error seems strange.

[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- enforcer:3.5.0:enforce (enforce-versions) @ jhipster-sample-application ---
[INFO] Rule 0: org.apache.maven.enforcer.rules.version.RequireMavenVersion passed
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.607 s
[INFO] Finished at: 2025-01-04T16:19:00+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.5.0:enforce (enforce-versions) on project jhipster-sample-application: 
[ERROR] Rule 1: org.apache.maven.enforcer.rules.version.RequireJavaVersion failed with message:
[ERROR] You are running an incompatible version of Java. JHipster supports JDK 17 to 23.
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

However, my Java version is 22.0.2, which should be supported according to the error message. Here is the output of java --version:

java --version
java 22.0.2 2024-07-16
Java(TM) SE Runtime Environment (build 22.0.2+9-70)
Java HotSpot(TM) 64-Bit Server VM (build 22.0.2+9-70, mixed mode, sharing)

I am confused. Can anyone help me with this issue?

Share Improve this question asked yesterday colommarcolommar 9 New contributor colommar is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
Add a comment  | 

1 Answer 1

Reset to default 0

The error message is saying you have to use Java 21 or 23. If you want to use Java 22, you'll need to adjust the enforcer plugin's configuration in your pom.xml.

最新文章