IntelliJ - Yet another "release version 5/15 not supported" error

已回答

I have read literally dozens of posts on this forum and others regarding this issue but none of the solutions work in my situation. I don't see any of the questions actually using Java 15, so I wonder if that's why other fixes aren't working.

I have IntelliJ IDEA 2020.3  (for Mac) I am using JDK 15.0.2. 

I go File-> New Project. Choose "Spring Initialzr". Set the Project SDK to 15 (version 15.0.2)

Type: Maven
Language: Java
Packaging: Jar
Java Version: 15

In the Dependencies window I choose Web -> Spring Web.

 

The project is created. I then go to build it and get "java: error: release version 5 not supported"

I validated File->Project Structure->Project SDK is 15 (version 15.0.2)

File->Project Structure->Language Level is "15 - Text Blocks"

 

In the project I validated .idea\misc.xml reads

<component name="ProjectRootManager" version="2" languageLevel="JDK_15" project-jdk-name="15" project-jdk-type="JavaSDK">

 

So things I change to try and fix based on other posts:

In IntelliJ -> Preferences -> Build, Execution, Deployment -> Java Compiler    The "Target Bytecode version" for the project is 1.5.  I change it to 15.

 

Now my error changes "release version 15 not supported"

 

So I add to pom.xml:

<properties>
<java.version>15</java.version>

<maven.compiler.source>14</maven.compiler.source>
<maven.compiler.target>14</maven.compiler.target>

</properties>


(note, <java.version>15</java.version> was already in properties so I only added the maven.compiler lines)

I STILL get "release version 15 not supported"

 

Anyone have help on how I can proceed?

评论操作 固定链接

Serge,

 

Good call.  That was set to Use Internal JRE "11".  I changed it to 15 and I stopped getting the "release version 15" error...

but I'm back to the "Release Version 5" error

0
评论操作 固定链接

Please share a sample project to reproduce the issue: https://uploads.jetbrains.com.

0
评论操作 固定链接

The project is uploaded to Upload id: 2021_03_03_HPyRgbScuJbJTALk (file: demo4.zip)

0
评论操作 固定链接

I can't reproduce the issue. .idea/compiler.xml has wrong bytecode version specified, but once I open the project in the IDE and it synchronizes it with pom.xml, the file gets updated to the following:

<bytecodeTargetLevel>
<module name="demo4" target="14" />
</bytecodeTargetLevel>

Do you run the current IntelliJ IDEA version from https://www.jetbrains.com/idea/download/index.html?

Does it help if you delete .idea directory and reimport the project from pom.xml?

0
评论操作 固定链接

I do have the latest build version (though I can't download it from Jetbrains.com as I'm on a managed desktop using a company install, but I validated build versions match).

 

How would I import from pom.xml? I can't find the "Import" feature which, per Google search, used to be on the welcome menu.  Now I only have "New Project" "Open" and "Get from VCS" and not seeing Import in the menu

0
评论操作 固定链接

Ok that's actually what I tried. Should that open the full project though? I just get the below, with none of the code files:

 

0
评论操作 固定链接

It should open a project if you choose Open as Project after deleting .idea directory.

Double check you don't open it as a file.

Also check the logs for possible exceptions: https://intellij-support.jetbrains.com/hc/en-us/articles/207241085.

0
评论操作 固定链接

Definitely opened it as a project.

Opening it put about 100 lines in the log file. one that is repeated that sticks out as a exception is

 


2021-03-03 13:50:35,505 [1280763] ERROR - aemon.impl.PassExecutorService - Project JDK is not specified. <a href='#open_project_jdk_settings'>Open Project SDK Configuration</a>
com.intellij.openapi.externalSystem.service.execution.ProjectJdkNotFoundException: Project JDK is not specified. <a href='#open_project_jdk_settings'>Open Project SDK Configuration</a>
at org.jetbrains.idea.maven.utils.MavenUtil.getJdk(MavenUtil.java:1323)
at org.jetbrains.idea.maven.server.MavenServerManager.getJdk(MavenServerManager.java:134)

0
评论操作 固定链接

It looks like an old bug that is fixed in 2020.3.2 release: https://youtrack.jetbrains.com/issue/IDEA-244634 .

See if defining the project JDK helps, then open Maven tool window and reimport: https://stackoverflow.com/a/43192764/104891.

0
评论操作 固定链接

I don't seem to be able to open it as a project.

I did the settings on the link you specified, but I don't have those options specifically. I was able to set "enable auto reload" but I don't have any options under Gradle. 

When I open pom.xml I get the following in the bottom left corner. I click "Load Maven Project" but it doesn't seem to change anything

0
评论操作 固定链接

Please upload the logs folder zipped at https://uploads.jetbrains.com or use Help | Collect Logs and Diagnostic Data.

0
评论操作 固定链接

Logs uploaded to Upload id: 2021_03_03_CWDXbuTbKtjZbkC4 (file: logs.zip)

0
评论操作 固定链接

Does it help if you specify the JDK at Project Structure | Project SDK?

0
评论操作 固定链接

Serge, thank you for all your help. I want you to know I greatly appreciate it.

 

Specifying the JDK did bring in the rest of the project. But now I'm having trouble with the dependencies.  I try to build and get 

 

demo4/src/main/java/com/example/demo4/Demo4Application.java:3:32
java: package org.springframework.boot does not exist

 

I've gone to Add Framework Support -> Thymeleaf  and in the bottom left it pops up:  "no files were downloaded for null"

 

I checked pom.xml and it does specify:


<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.4.3</version>


and


<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>

</dependency>
0
评论操作 固定链接

Update: I did something... and I no longer get that message.

 

Now I'm getting 

Maven dependency resolver: Error resolving dependencies for demo4:
java.lang.NullPointerException: Cannot invoke "String.equals(Object)" because "this.myMavenId" is null:
Cannot invoke "String.equals(Object)" because "this.myMavenId" is null

 

0
评论操作 固定链接

Does the project build without errors in the command line outside of the IDE if you run "mvn clean package"?

It looks like IDE is not able to download the dependencies as your Internet connection may be limited.

See if configuring a proxy for Maven helps: https://maven.apache.org/guides/mini/guide-proxies.html .

Normally your project would import automatically and all the dependencies will be available:

The specific errors about importing can be found in the IDE logs.

Click the Reload button and see if it completes without errors:

0
评论操作 固定链接

I try "mvn clean package"

it says "command not found: mvn"

I have configured the proxy settings for Intellij and confirmed those work. When I first set up this project it got maven through that proxy.  From the link you specified, I cannot find a settings.xml under an m2 directory. The only settings.xml I have on my system is, in fact, for IntelliJ and it had the correct Proxy information.

 

And I don't have any of the springframework items listed under dependencies so I cannot try Reload all maven projects.

 

Sorry to be difficult on this with one problem after another. I'm not sure why this is so difficult.

0
评论操作 固定链接

You may need to install Maven and add it to PATH so that you can run it from the command line and test it.

If there is no settings.xml file, you will have to create a new one and define the proxy there.

0
评论操作 固定链接

is there a method to install Maven through IntelliJ? 

Also, I disconnected from the network where I needed a proxy, went to an open network. Started all over from the beginning with new demo5.  Got stuck again at

demo4/src/main/java/com/example/demo4/Demo4Application.java:3:32
java: package org.springframework.boot does not exist

 

I had to go through every step we did prior to get that far. 

0
评论操作 固定链接

Maven should be installed standalone, outside of the IDE so that you can test if it works at all in your environment, please refer to https://maven.apache.org/install.html .

Maven build sync should complete without errors in the IDE and you will see the dependencies in the Project view and Maven tool windows.

If the sync fails or you don't see the dependencies, inspec IDE logs, there must be some other error logged. Upload the logs at https://uploads.jetbrains.com so that we can see what happens.

0

请先登录再写评论。