0

After I accidentally changed the java version (downgraded it from 17 to 11) from settings menu, my PyCharm wont start at all. I even tried to remove it and reinstall it but nothing happens so far. Getting the below error after reinstalling pycharm. I know I can delete all the files related to Pycharm in my ubuntu system, and reinstall, however I am looking for some elegant solution where I can bring back to the previous state.

Error:

$ pycharm-professional 
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
CompileCommand: exclude com/intellij/openapi/vfs/impl/FilePartNodeRoot.trieDescend bool exclude = true

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

java.lang.IllegalStateException: @NotNull method com/intellij/util/ui/EDT.getEventDispatchThread must not return null
    at com.intellij.util.ui.EDT.$$$reportNull$$$0(EDT.java)
    at com.intellij.util.ui.EDT.getEventDispatchThread(EDT.java:48)
    at com.intellij.idea.StartupUtil$startApplication$appDeferred$1$rwLockHolderDeferred$1.invokeSuspend(StartupUtil.kt:231)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
    Suppressed: java.lang.UnsatisfiedLinkError: Can't load library: /usr/lib/jvm/java-17-openjdk-amd64/lib/libawt_xawt.so
        at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2393)
        at java.base/java.lang.Runtime.load0(Runtime.java:755)
        at java.base/java.lang.System.load(System.java:1953)
        at java.base/jdk.internal.loader.NativeLibraries.load(Native Method)
        at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:388)
        at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:232)
        at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:174)
        at java.base/jdk.internal.loader.NativeLibraries.findFromPaths(NativeLibraries.java:315)
        at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:285)
        at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2398)
        at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:818)
        at java.base/java.lang.System.loadLibrary(System.java:1989)
        at java.desktop/java.awt.Toolkit$2.run(Toolkit.java:1392)
        at java.desktop/java.awt.Toolkit$2.run(Toolkit.java:1390)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:318)
        at java.desktop/java.awt.Toolkit.loadLibraries(Toolkit.java:1389)
        at java.desktop/java.awt.Toolkit.initStatic(Toolkit.java:1427)
        at java.desktop/java.awt.Toolkit.<clinit>(Toolkit.java:1401)
        at java.desktop/java.awt.Color.<clinit>(Color.java:277)
        at com.intellij.ide.ui.laf.IdeaLaf.<clinit>(IdeaLaf.java:24)
        at java.base/java.lang.Class.forName0(Native Method)
        at java.base/java.lang.Class.forName(Class.java:467)
        at com.intellij.idea.StartupUtil$preloadLafClasses$1.invokeSuspend(StartupUtil.kt:518)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
        at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
        at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
        ... 4 more
        Suppressed: java.lang.NoClassDefFoundError: Could not initialize class java.awt.Toolkit
            at java.desktop/java.awt.EventQueue.invokeLater(EventQueue.java:1314)
            at com.intellij.openapi.application.impl.RawSwingDispatcher.dispatch(RawSwingDispatcher.kt:16)
            at kotlinx.coroutines.internal.DispatchedContinuationKt.resumeCancellableWith(DispatchedContinuation.kt:322)
            at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable(Cancellable.kt:30)
            at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable$default(Cancellable.kt:25)
            at kotlinx.coroutines.CoroutineStart.invoke(CoroutineStart.kt:110)
            at kotlinx.coroutines.AbstractCoroutine.start(AbstractCoroutine.kt:126)
            at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch(Builders.common.kt:56)
            at kotlinx.coroutines.BuildersKt.launch(Unknown Source)
            at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch$default(Builders.common.kt:47)
            at kotlinx.coroutines.BuildersKt.launch$default(Unknown Source)
            at com.intellij.idea.StartupUtil$updateFrameClassAndWindowIconAndPreloadSystemFonts$1.invokeSuspend(StartupUtil.kt:582)
            at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
            at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
            ... 4 more
        Suppressed: [CIRCULAR REFERENCE: java.lang.IllegalStateException: @NotNull method com/intellij/util/ui/EDT.getEventDispatchThread must not return null]

-----
Your JRE: 17.0.6+10-Ubuntu-0ubuntu122.04 amd64 (Private Build)
/usr/lib/jvm/java-17-openjdk-amd64

Also, a UI exception occurred on an attempt to show the above message
java.lang.NoClassDefFoundError: Could not initialize class java.awt.Toolkit
    at java.desktop/java.awt.Component.<clinit>(Component.java:624)
    at com.intellij.idea.StartupErrorReporter.showMessage(StartupErrorReporter.java:85)
    at com.intellij.idea.StartupErrorReporter.showMessage(StartupErrorReporter.java:39)
    at com.intellij.idea.Main.main(Main.kt:71)
s510
  • 2,271
  • 11
  • 18
  • I'm guessing the new incompatible Java is being taken from [the system path](https://stackoverflow.com/questions/5971312/how-to-set-environment-variables-in-python) so if you change it there PyCharm should start working again. – bad_coder May 05 '23 at 20:15

0 Answers0