Search code examples
javaubuntuintellij-idea

IntelliJ IDEA doesn't start on Ubuntu after Change the boot Java runtime


Before, my IntelliJ ran well. But I used java 6 , so my project could not run with gradle. I switched java to version 8 with the command sudo update-alternatives --config java . I checked java -version was 1.8.0_312. It's OK, but in IntelliJ, the Java still had version 6. Then, I changed java version in IntelliJ with:

From the main menu, select Help | Find Action or press Ctrl+Shift+A.

Find and select the Choose Boot Java Runtime for the IDE action.

Select the desired runtime and click OK.

And restarted IntelliJ, which could not be opened again. I tried to remove and install it again as well as removing java and installing it again too, but neither did work. When I run ./idea.sh, I get the following error:

OpenJDK 64-Bit Server VM warning: Archived non-system classes are disabled because the java.system.class.loader property is specified (value = "com.intellij.util.lang.PathClassLoader"). To use archived non-system classes, this property must not be set
Error: LinkageError occurred while loading main class com.intellij.idea.Main
    java.lang.ExceptionInInitializerError: null

Now, I'm not even able to "change JRE in intelliJ" as suggested in the comments any more.


Solution

  • I've had the same issue working on windows.

    When you check IntelliJ's log (idea.log file) you can find a entry for the change you've made with its 'reset' option.

    For me it was: (emphasis is mine)

    2022-08-08 09:47:47,906 [ 594730] WARN - Downloader.RuntimeChooserPaths - Set custom boot runtime to: C:\Data\Java\jdk-17.0.3.1 in the C:\Users\username\AppData\Roaming\JetBrains\IntelliJIdea2021.3\idea64.exe.jdk. On errors, please remove the .jdk file

    You find the log files are stored at:

    Linux: ~/.cache/JetBrains/IntelliJIdea2020.3/log

    Windows: %LOCALAPPDATA%\JetBrains\IntelliJIdea2020.3\log

    macOS: ~/Library/Logs/JetBrains/IntelliJIdea2020.3