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

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

    Details

    • Subcomponent:
    • Resolved In Build:
      b110
    • CPU:
      generic
    • OS:
      os_x

      Description

      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);
          }
      }

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: