IntelliJ won't open after update to Java 17

Viewed 3966

I updated Java from Java 16 to Java 17 and now my editor won't work. I use IntelliJ and here is the error message:

Internal error. Please refer to https://jb.gg/ide/critical-startup-errors

java.lang.IllegalAccessError: class com.intellij.idea.StartupUtil (in unnamed module @0x4bbd0bd0) cannot access class sun.awt.AWTAutoShutdown (in module java.desktop) because module java.desktop does not export sun.awt to unnamed module @0x4bbd0bd0
    at com.intellij.idea.StartupUtil.start(StartupUtil.java:297)
    at com.intellij.idea.Main.bootstrap(Main.java:123)
    at com.intellij.idea.Main.main(Main.java:84)

-----
Your JRE: 17+35-LTS-2724 amd64 (Oracle Corporation)
C:\Program Files\Java\jdk-17
3 Answers

Current IntelliJ IDEA version requires Java 11 to run. Remove the overrides (idea.jdk file/environment variables) to use the default bundled JetBrains Runtime.

In Windows, run the below command in the cmd window

%APPDATA%\JetBrains\

you will find the IntelliJ settings files, look for the jdk file and delete it.

If you are on windows 10+, try to Run Intellij as an administrator. I had no idea.jdk or IDEA_JDK variable to clean and this solution worked for me.

Related