mbeddr / mps-build-backends

Command-line utilities used e.g. by Gradle plugins to generate or check models.
Apache License 2.0
3 stars 4 forks source link

Modelcheck fails to start with JDK 17 #10

Closed SebastianSausN closed 9 months ago

SebastianSausN commented 1 year ago

As the title says I tried running modelcheck with JDK 17 via maven and got an IllegalAccessError. After switching back to JDK 11 everything works fine. Im using:

Best Regards Sebastian

     [echo] *** Running model check for languages ***
     [java] 2023-08-29 16:05:12,630 [    100] SEVERE - #c.i.i.StartupUtil - Cannot start app
     [java] com.intellij.ide.plugins.StartupAbortedException: Cannot start app
     [java]     at com.intellij.idea.StartupUtil.lambda$start$15(StartupUtil.java:265)
     [java]     at java.base/java.util.concurrent.CompletableFuture.uniExceptionally(CompletableFuture.java:990)
     [java]     at java.base/java.util.concurrent.CompletableFuture.uniExceptionallyStage(CompletableFuture.java:1008)
     [java]     at java.base/java.util.concurrent.CompletableFuture.exceptionally(CompletableFuture.java:2364)
     [java]     at com.intellij.idea.StartupUtil.start(StartupUtil.java:264)
     [java]     at jetbrains.mps.tool.environment.MPSHeadlessPlatformStarter$Holder.createApp(MPSHeadlessPlatformStarter.java:50)
     [java]     at jetbrains.mps.tool.environment.IdeaEnvironment.createIdeaApplication(IdeaEnvironment.java:186)
     [java]     at jetbrains.mps.tool.environment.IdeaEnvironment.init(IdeaEnvironment.java:78)
     [java]     at de.itemis.mps.gradle.project.loader.ProjectLoader.execute(ProjectLoader.kt:107)
     [java]     at de.itemis.mps.gradle.project.loader.ProjectLoader.executeWithProject(ProjectLoader.kt:154)
     [java]     at de.itemis.mps.gradle.modelcheck.MainKt$main$1.invoke(Main.kt:14)
     [java]     at de.itemis.mps.gradle.modelcheck.MainKt$main$1.invoke(Main.kt:7)
     [java]     at com.xenomachina.argparser.SystemExitExceptionKt.mainBody(SystemExitException.kt:74)
     [java]     at com.xenomachina.argparser.SystemExitExceptionKt.mainBody$default(SystemExitException.kt:72)
     [java]     at de.itemis.mps.gradle.modelcheck.MainKt.main(Main.kt:7)
     [java] Caused by: java.lang.IllegalAccessError: class com.intellij.idea.StartupUtil (in unnamed module @0x289e7b8) cannot access class sun.awt.AWTAutoShutdown (in module java.desktop) because module java.desktop does not export sun.awt to unnamed module @0x289e7b8
     [java]     at com.intellij.idea.StartupUtil.lambda$scheduleInitUi$21(StartupUtil.java:534)
     [java]     at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646)
     [java]     at java.base/java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:482)
     [java]     at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
     [java]     at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:771)
     [java]     at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:722)
     [java]     at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:716)
     [java]     at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
     [java]     at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
     [java]     at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:741)
     [java]     at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
     [java]     at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
     [java]     at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
     [java]     at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
     [java]     at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
     [java]     at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
     [java] 2023-08-29 16:05:12,686 [    156] SEVERE - #c.i.i.StartupUtil - JetBrains MPS 2022.2  Build #MPS-222.3345.1295
     [java] 2023-08-29 16:05:12,687 [    157] SEVERE - #c.i.i.StartupUtil - JDK: 17.0.7; VM: OpenJDK 64-Bit Server VM; Vendor: Azul Systems, Inc.
     [java] 2023-08-29 16:05:12,688 [    158] SEVERE - #c.i.i.StartupUtil - OS: Windows 10
     [java]
     [java] Start Failed
     [java] Internal error. Please refer to https://jb.gg/ide/critical-startup-errors
     [java]
     [java] com.intellij.ide.plugins.StartupAbortedException: Cannot start app
     [java]     at com.intellij.idea.StartupUtil.lambda$start$15(StartupUtil.java:265)
     [java]     at java.base/java.util.concurrent.CompletableFuture.uniExceptionally(CompletableFuture.java:990)
     [java]     at java.base/java.util.concurrent.CompletableFuture.uniExceptionallyStage(CompletableFuture.java:1008)
     [java]     at java.base/java.util.concurrent.CompletableFuture.exceptionally(CompletableFuture.java:2364)
     [java]     at com.intellij.idea.StartupUtil.start(StartupUtil.java:264)
     [java]     at jetbrains.mps.tool.environment.MPSHeadlessPlatformStarter$Holder.createApp(MPSHeadlessPlatformStarter.java:50)
     [java]     at jetbrains.mps.tool.environment.IdeaEnvironment.createIdeaApplication(IdeaEnvironment.java:186)
     [java]     at jetbrains.mps.tool.environment.IdeaEnvironment.init(IdeaEnvironment.java:78)
     [java]     at de.itemis.mps.gradle.project.loader.ProjectLoader.execute(ProjectLoader.kt:107)
     [java]     at de.itemis.mps.gradle.project.loader.ProjectLoader.executeWithProject(ProjectLoader.kt:154)
     [java]     at de.itemis.mps.gradle.modelcheck.MainKt$main$1.invoke(Main.kt:14)
     [java]     at de.itemis.mps.gradle.modelcheck.MainKt$main$1.invoke(Main.kt:7)
     [java]     at com.xenomachina.argparser.SystemExitExceptionKt.mainBody(SystemExitException.kt:74)
     [java]     at com.xenomachina.argparser.SystemExitExceptionKt.mainBody$default(SystemExitException.kt:72)
     [java]     at de.itemis.mps.gradle.modelcheck.MainKt.main(Main.kt:7)
     [java] Caused by: java.lang.IllegalAccessError: class com.intellij.idea.StartupUtil (in unnamed module @0x289e7b8) cannot access class sun.awt.AWTAutoShutdown (in module java.desktop) because module java.desktop does not export sun.awt to unnamed module @0x289e7b8
     [java]     at com.intellij.idea.StartupUtil.lambda$scheduleInitUi$21(StartupUtil.java:534)
     [java]     at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646)
     [java]     at java.base/java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:482)
     [java]     at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
     [java]     at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:771)
     [java]     at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:722)
     [java]     at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:716)
     [java]     at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
     [java]     at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
     [java]     at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:741)
     [java]     at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
     [java]     at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
     [java]     at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
     [java]     at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
     [java]     at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
     [java]     at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
     [java]
     [java] -----
     [java] Your JRE: 17.0.7+7-LTS amd64 (Azul Systems, Inc.)
     [java] C:\Program Files\Java\jdk17
SebastianSausN commented 1 year ago

Never mind, that was user error. Adding the additional jvm arguments from https://www.jetbrains.com/help/mps/migration-guide.html#usingjdk17 solved the problem.