hpi-swa / trufflesqueak

A Squeak/Smalltalk VM and Polyglot Programming Environment for the GraalVM.
MIT License
286 stars 14 forks source link

org.graalvm.polyglot.PolyglotException: java.awt.HeadlessException #144

Closed Hendekagon closed 3 years ago

Hendekagon commented 3 years ago

I get this when I run trufflesqueak in MacOS 11.2.3 with the GraalVM 21.1:

[trufflesqueak] Running Squeak/Smalltalk on GraalVM CE... [trufflesqueak] Image loaded in 3418ms. ERROR: java.awt.HeadlessException org.graalvm.polyglot.PolyglotException: java.awt.HeadlessException at java.desktop/java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:208) at java.desktop/java.awt.Window.(Window.java:548) at java.desktop/java.awt.Frame.(Frame.java:423) at de.hpi.swa.trufflesqueak.io.SqueakDisplay.(SqueakDisplay.java:66) at de.hpi.swa.trufflesqueak.image.SqueakImageContext.attachDisplayIfNecessary(SqueakImageContext.java:566) at de.hpi.swa.trufflesqueak.SqueakImage.execute(SqueakImage.java:64) at de.hpi.swa.trufflesqueak.SqueakImageGen$InteropLibraryExports$Cached.execute(SqueakImageGen.java:77) at org.graalvm.truffle/com.oracle.truffle.api.interop.InteropLibraryGen$CachedDispatch.execute(InteropLibraryGen.java:7592) at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotValue$InteropCodeCache$AbstractExecuteNode.executeShared(PolyglotValue.java:3097) at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotValue$InteropCodeCache$ExecuteNoArgsNode.executeImpl(PolyglotValue.java:3204) at org.graalvm.truffle/com.oracle.truffle.polyglot.HostToGuestRootNode.execute(HostToGuestRootNode.java:134) at org.graalvm.sdk/org.graalvm.polyglot.Value.execute(Value.java:832) at de.hpi.swa.trufflesqueak.launcher.TruffleSqueakLauncher.execute(TruffleSqueakLauncher.java:125) at de.hpi.swa.trufflesqueak.launcher.TruffleSqueakLauncher.launch(TruffleSqueakLauncher.java:78) at org.graalvm.launcher.AbstractLanguageLauncher.launch(AbstractLanguageLauncher.java:124) at org.graalvm.launcher.AbstractLanguageLauncher.launch(AbstractLanguageLauncher.java:71) at de.hpi.swa.trufflesqueak.launcher.TruffleSqueakLauncher.main(TruffleSqueakLauncher.java:43) Original Internal Error: java.awt.HeadlessException

Caused by: Attached Guest Language Frames (1)

fniephaus commented 3 years ago

How do you launch TruffleSqueak on your command line? According to your stack trace, TruffleSqueak tries to open a display, but fails because AWT is running in headless mode.

Hendekagon commented 3 years ago

solved. For some reason the zsh session I was running graalvm in would always return sun.java2d.HeadlessGraphicsEnvironment for java.awt.GraphicsEnvironment/getLocalGraphicsEnvironment . The solution was to start a new terminal and it worked

fniephaus commented 3 years ago

Good, glad it's working now!