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

-XstartOnFirstThread needs to be allowed as argument in java-vm-args

XMLWordPrintable

    • x86
    • os_x

      A DESCRIPTION OF THE REQUEST :
      To run SWT applications on OSX it is necessary to specify the -XstartOnFirstThread in java-vm-args (see https://www.eclipse.org/swt/macosx/).

      According to the jnlp-syntax (http://docs.oracle.com/javase/7/docs/technotes/guides/javaws/developersguide/syntax.html) this argument is currently not marked as allowed and therefore the jvm is started without the argument and this results in a crash of the application with

      !MESSAGE Application error
      !STACK 1
      org.eclipse.swt.SWTException: Invalid thread access
              at org.eclipse.swt.SWT.error(SWT.java:4361)
              at org.eclipse.swt.SWT.error(SWT.java:4276)
              at org.eclipse.swt.SWT.error(SWT.java:4247)
              at org.eclipse.swt.widgets.Display.error(Display.java:1070)
              at org.eclipse.swt.widgets.Display.createDisplay(Display.java:827)
              at org.eclipse.swt.widgets.Display.create(Display.java:810)
              at org.eclipse.swt.graphics.Device.<init>(Device.java:130)
              at org.eclipse.swt.widgets.Display.<init>(Display.java:701)
              at org.eclipse.swt.widgets.Display.<init>(Display.java:692)
              at org.eclipse.ui.internal.Workbench.createDisplay(Workbench.java:716)
              at org.eclipse.ui.PlatformUI.createDisplay(PlatformUI.java:161)

      So please mark -XstartOnFirstThread as allowed in java-vm-args (at least on OSX).

      Thanks

      JUSTIFICATION :
      According to: https://www.eclipse.org/swt/macosx/

      The special VM option -XstartOnFirstThread is also required for SWT applications to run properly on the Mac.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      VM-argument -XstartOnFirstThread is passed through to the vm.
      ACTUAL -
      -XstartOnFirstThread is fiotert because it is not marked as secure argument...

      CUSTOMER SUBMITTED WORKAROUND :
      Don't use a mac... :-(

            herrick Andy Herrick (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: