this month, Java 17 was finally released. This is another lts version after Java 11. I decided to try Java 17. Sure enough, something unexpected happened: when I used java 17 to run a project that used to run normally, IntelliJ idea reported the following error:
Operating environment when the author reports an error:
IntelliJ IDEA 2020.1.2 (Ultimate Edition)
JDK 17
Error:Cannot determine path to 'tools.jar' library for 17 (C:\Program Files\Java\jdk-17)
then, as before. The author tried to run a very simple demo project, and sure enough, the same error occurred again. The environment in which the project used to operate normally is:
The environment in which the project previously operated normally:
IntelliJ IDEA 2020.1.2 (Ultimate Edition)
JDK 11
the author has repeatedly installed multiple versions of Java on different operating systems, and is very familiar with this error report. This error indicates that the current IntelliJ idea cannot parse this version of JDK, so it tries to parse tools. Jar
from its built-in environment variable classpath
, but it still fails, so it throws the above error message.
this can be confirmed. It can be clearly seen in the project structure
in the figure below that the author’s IntelliJ idea 2020.1.2 (Ultimate Edition)
supports parsing JDK 14 at most, so there is nothing to do with Java 17.
Method 1
it’s easy to do when you know the reason. One way is to reduce the JDK version so that the current IntelliJ idea can recognize it.
The environment in which the project previously operated normally:
IntelliJ IDEA 2020.1.2 (Ultimate Edition)
JDK 11
install the lower version of JDK first, and then set it in project structure
in IntelliJ idea. See the figure below. But I usually don’t like it.
Method 2
another way is to improve the version of IntelliJ idea. Therefore, the author specially downloaded and installed the latest IntelliJ idea 2021.2.2 (Ultimate Edition)
. Unexpectedly and reasonably, the author encountered many holes when installing the latest IntelliJ idea. I have always wanted to stand on the shoulders of giants, but in fact, they are always used as stepping stones by giants. For the problem that IntelliJ idea cannot be opened after installation, see another blog of the author:
solve the problem that the interface disappears after IntelliJ idea is installed, and the interface does not move after it is opened again.
when I first downloaded it, I was worried that it could not parse Java 17, but now it seems that this worry is superfluous.
The environment in which the project operates normally:
IntelliJ IDEA 2021.2.2 (Ultimate Edition)
JDK 17
after upgrading IntelliJ idea, configure project structure
as follows.
Read More:
- [Solved] Error:Cannot determine path to ‘tools.jar‘ library for 17
- [Solved] IDEA springboot Startup Error: java.lang.UnsatisfiedLinkError: no tcnative-1 in java.library.path
- [Solved] IntelliJ IDEA Start Error: Failed to create JVM.JVM Path
- IntelliJ idea compilation error: Error:java : Compilation failed: internal java compiler error
- IntelliJ idea error: e rror:java : invalid source distribution: 11 problem resolution
- [Solved] IntelliJ idea error: error: Java does not support release 5
- JAVA: How to use the third-party font library method (using the third-party TTF / TTC font library method)
- How to Solve IDEA @Autowired Error
- How to Solve idea com.baomidou Error
- IDEA-Error java error release version 5 not supported (How To Fix)
- How to Solve Assert error (IDEA Package Imported)
- JAVA: How to Use Multipartfile to upload Files
- How to Solve IDEA Error: Command line is too long
- How to Solve ERROR: Java 1.7 or later is required to run Apache Drill
- How to Open Files by Dragging and Dropping in C#
- How to Solve java server error (java application Run Normally)
- How to Solve RAR Files Extract Error with sevenzipjbinding (Multithread Processing)
- [Solved] IDEA Error(15, 16) java Program Pack sun.misc does not exsit or import sun.misc.BASE64Decoder Cannot find
- How to Solve Java Runtime (class file version 53.0)ERROR
- How to Solve JAVA Error: error: A JNI error has occureed