Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8022555

[macosx] AppleScriptEngine.jar MUST call java.awt.Toolkit.getDefaultToolkit() lazily

XMLWordPrintable

    • b110
    • generic
    • os_x

      This call is preventing headless apps that use ScriptEngine from running. The way the static init is structured currently, the AWT Toolkit is initialized on registration as a script engine. The AWT Toolkit init should not take place unless the app uses the AppleScriptEngine.

      The following example will cause a menu bar to appear on a headless app (when it should not.)


      import javax.script.ScriptEngineManager;

      public class EngineTest {
          public static void main(String[] args) throws Exception {
              new ScriptEngineManager();
              Thread.sleep(100000);
          }
      }

            leonidr Leonid Romanov (Inactive)
            jlaskey Jim Laskey
            Votes:
            3 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: