Cannot determine path to 'tools.jar' library for 1.8 (C:\Program Files\Java\jdk-17.0.2)
A few months ago, I downloaded Java 17 and had absolutely no problems with it while working on android studio. However, when I opened my IntelliJ IDEA and tried running a simple app, this error suddenly occured.
I went on googling the solutions, but strangely enough, nothing worked. The ones I have tried were
- Adding JAVA_HOME to environment variables
- Adding gradle.properties file with JDK path to the root directory
- Reinstalling Java
None of the above solutions worked, and it seemed so weird since it did not look like a complicated issue, and Java was still working perfectly fine in other IDEs.
Then, I came up to see this answer from JetBrains: Link to the discussion
To sum it up, there are two solutions to figure this out.
1) Install Java of lower version
2) Install IntelliJ IDEA of 2022.1 or above
And yes, that was when I noticed that my version of IntelliJ was pretty old, lol.
Since I wanted to keep on working with Java 17, I downloaded the latest version of IntelliJ IDEA and everything was sorted out.
Oh and one thing, when installing the latest version of IntelliJ, don't delete the older version - IntelliJ automatically detects if there is an older version installed, and asks if you want the configurations to be set the same as they were in the older version. This can be done by ticking the box for silent uninstallation.
Hope everything's sorted out now!
Comments
Post a Comment