Maven archetype quickstart issue with JDK 25?

I'm new with using Maven (Via IntelliJ IDEA), and I found maven archetype quickstart (v.1.5) as the most recommended 'quickstart' for projects. I tried it and it worked successfully - src folders and pom.xml generated, but it uses JDK 17. I did some google search and I found that archetype quickstart only 'supports' up to JDK 17. Now, I'm trying to make it work with JDK 25. Keep in mind I have no knowledge with Maven, but I want to use it to finish a simple project of mine (learning Maven properly will come after this as I'm on a deadline). In my pom.xml, I configured the compiler plugin to use JDK 25 (suggested by GPT):
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version>
<configuration>
<source>25</source>
<target>25</target>
<release>25</release>
</configuration>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version>
<configuration>
<source>25</source>
<target>25</target>
<release>25</release>
</configuration>
- In IntelliJ's Build, Execution, Deployment>Java Compiler settings I have set the Project bytecode version and Target bytecode version to use 25 - Project Structure: Language level set to 25 - Modules: Language level set to 25 - Modules>Dependencies: Module SDK set to JDK 25 - Path Environment and JAVA_HOME are also properly configured as I've tested and used it prior to using Maven However, whenever I try to run the program, the program generates this error:
java: Cannot start javac process for enhanced-inventory-management: it is configured to use JDK 0, but IDE supports compilation using JDK 7 and newer only.
Consider associating the module with a supported JDK version. Note, that it is possible to keep the current Java language level to make produced *.class files compatible with Java 25 even when they are compiled by a newer compiler version.
java: Cannot start javac process for enhanced-inventory-management: it is configured to use JDK 0, but IDE supports compilation using JDK 7 and newer only.
Consider associating the module with a supported JDK version. Note, that it is possible to keep the current Java language level to make produced *.class files compatible with Java 25 even when they are compiled by a newer compiler version.
It only happens when I try to use JDK 25, but it successfully run when I use the default version which is JDK 17. What am I doing wrong here? Is it not possible to run with JAVA 25?
6 Replies
JavaBot
JavaBot2mo ago
This post has been reserved for your question.
Hey @Loydiee! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
Loydiee
LoydieeOP2mo ago
Should I skip using Maven Archetypes and use default Maven if I want to use JDK 25?
dan1st
dan1st2mo ago
- The release option should be sufficient, you shouldn't need a source and target version - Use the latest version of Maven 3 abd IntelliJ - Reload the Maven project in IntelliJ after updating the pom.xml - Does mvn clean verify suceed? - If all of that doesn't help, does it work with 21? the archetype doesn't matter, 17 is just the default version
Loydiee
LoydieeOP2mo ago
Hi, thanks for the reply. - I'm using Bundled (Maven 3) which is Version 3.9.9 and latest version of IntelliJ IDEA Community Version - I tried reloading the Maven project after updating the pom.xml - mvn clean verify succeeded
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.135 s
[INFO] Finished at: 2025-10-31T14:24:30+08:00
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.135 s
[INFO] Finished at: 2025-10-31T14:24:30+08:00
[INFO] ------------------------------------------------------------------------
But still giving the same error when I try to run with Java 25 - Yes it works with Java 21 I've actually asked a similar question to Jetbrains CS support, when I was using JavaFX with Maven, I've encountered the same issue. It was solved by simply using Java 17 or 21 instead of Java 25. Unfortunately, the CS didn't answer why did that happen. UPDATE: I've solved it. I tried changing the SDK from locally installed (downloaded from the official site) Java 25 to OpenJDK 25 (from IntelliJ IDEA) and it worked and now compile with Java 25. I uninstalled the Java 25 from my computer then went to Oracle's official website to install JDK 25.0.1, afterwards used it as the project's SDK, reloaded the maven, and now works successfully! It even automatically changed the pom.xml to configure maven compiler to use Java 25. I guess the issue is something gone wrong with my locally installed Java 25 that I downloaded last month but didn't notice it because it was the one I used to create some projects last week. Thank you for the help and sorry for the inconvenience!
JavaBot
JavaBot2mo ago
If you are finished with your post, please close it. If you are not, please ignore this message. Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
JavaBot
JavaBot2mo ago
Post Closed
This post has been closed by <@332873329960812555>.

Did you find this page helpful?