Cannot determine path to 'tools.jar' library for 18 (C:/Program Files/jdk-18.0.1.1)
Asked Answered
B

3

15

i want to run my code in intellij ide (community edition) and when i try to run it, i got this error

Cannot determine path to 'tools.jar' library for 18 (C:/Program Files/jdk-18.0.1.1)

This is the ScreenShot of the error

help me pls... i want to learn kotlin use intellij ide

And this is my JAVA_HOME

version ide : 2020.2 Thank you :)

Biblio answered 3/5, 2022 at 13:34 Comment(5)
Go to File -> Project Settings -> SDKs and check that "18" is properly configured.Herb
@Herb do you mean project structure? its already 18Biblio
Check the folder paths for "18" under "Platform Settings"Herb
@Herb and then?Biblio
Check that the folders and files named under "18" (in particular, those in the Classpath tab) actually exist on your machine.Herb
P
31

The problem is with version of JDK you are using. The Intellij version 2020.2 supports only upto JDK 14. So either you have to lower the JDK version to 14 or update the IntelliJ to a newer version like 2021.

Source: https://www.jetbrains.com/help/idea/supported-java-versions.html

Polloch answered 9/5, 2022 at 6:7 Comment(1)
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Heilbronn
P
4

I faced the same error recently (Nov 2022)

Error:Cannot determine path to 'tools.jar' library for 17 (C:\Program Files\Java\jdk-17.0.5)

when using IntelliJ IDEA 2020.1.4 with JDK 17.0.5. Issue is resolved by switching to open JDK amazon-corretto-11, you can download it from here https://docs.aws.amazon.com/corretto/latest/corretto-11-ug/downloads-list.html

Amazon Corretto is a no-cost, multiplatform, production-ready distribution of the Open Java Development Kit (OpenJDK). Corretto comes with long-term support that includes performance enhancements and security fixes.

Purposive answered 24/11, 2022 at 12:42 Comment(0)
A
2

I solved the same problem this morning, i had tried many approaches like upgrading to latest JDK and downgrading to older JDKs. None of them helped me. Finally I updated to IntelliJ IDEA 2023.2.3 (Community Edition), and things started working smoothly.

Allhallows answered 13/10, 2023 at 13:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.