Search code examples
macoseclipse-rcptychop2

Mac distribution of Eclipse RCP application built with Tycho on Windows doesn't start


I have built an Eclipse RCP application (Indigo) with Tycho. The build is run on a Win 7, 64-bit machine.

The parent POM includes:

<plugin>
  <groupId>org.eclipse.tycho</groupId>
  <artifactId>target-platform-configuration</artifactId>
  <version>${tycho-version}</version>
  <configuration>
  <resolver>p2</resolver>

  <environment>
    <os>linux</os>
    <ws>gtk</ws>
    <arch>x86_64</arch>
  </environment>
  <environment>
    <os>win32</os>
    <ws>win32</ws>
    <arch>x86_64</arch>
  </environment>
  <environment>
    <os>macosx</os>
    <ws>cocoa</ws>
    <arch>x86_64</arch>
  </environment>

...

The product configuration looks like this (with a few omissions and extra line breaks for readbility):

<product name="My App" uid="myapp.product" id="myapp.core.product" application="myapp.core.application" version="0.1.4.qualifier" useFeatures="true" includeLaunchers="true">

   <configIni use="default">
   </configIni>

   <launcherArgs>
      <programArgs>-data @noDefault</programArgs>
      <vmArgsMac>-XstartOnFirstThread
                         -Dorg.eclipse.swt.internal.carbon.smallFonts</vmArgsMac>
   </launcherArgs>

   <launcher name="myapp_0_1_4">
      <solaris/>
      <win useIco="false">
         <bmp/>
      </win>
   </launcher>

   <vm>
      <macos include="false">org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6</macos>
   </vm>

   <plugins>
      <plugin id="com.ibm.icu"/>
      <plugin id="myapp.core"/>
      <plugin id="org.eclipse.core.runtime"/>
      <plugin id="org.eclipse.core.runtime.compatibility.registry" fragment="true"/>
      <plugin id="org.eclipse.equinox.app"/>
      <plugin id="org.eclipse.equinox.common"/>
      <plugin id="org.eclipse.osgi"/>
      <plugin id="org.eclipse.swt"/>
      <plugin id="org.eclipse.swt.win32.win32.x86_64" fragment="true"/>
      <plugin id="org.eclipse.ui"/>
      <plugin id="org.eclipse.ui.workbench"/>
   </plugins>

   <features>
      <feature id="org.eclipse.rcp" version="3.7.2.v20120120-1424-9DB5FmnFq5JCf1UA38R-kz0S0272"/>
      <feature id="myapp.platform_dependencies.feature" version="0.1.4.qualifier"/>
      <feature id="myapp.core.feature" version="0.1.4.qualifier"/>
      <feature id="myapp.ui.feature" version="0.1.4.qualifier"/>
      <feature id="myapp.model.feature" version="0.1.4.qualifier"/>
   </features>

   <configurations>
      <plugin id="org.eclipse.core.runtime" autoStart="true" startLevel="0" />
      <plugin id="org.eclipse.equinox.common" autoStart="true" startLevel="2" />
   </configurations>

</product>

The build runs without problems, and generates zip files, which, unpacked on the target OSs Windows & Linux include working launchers. (On Linux, I have to make the launcher executable before being able to run it.)

On Mac OS X (10.6.8), however, the launcher (myapp.app) does nothing...

When I run java -jar -XstartOnFirstThread plugins/org.eclipse.equinox.launcher_[version], the application is launched, albeit without the splash screen.

I imagine I have a wrong setting anywhere in my Product Configuration, but I cannot mind which.


Solution

  • Cross-platform build on Windows for Mac is not expected to work. The reason is that Tycho/p2 would need to simulate a file system with Unix permissions. There is a request for this in Tycho's issue tracker, but IMHO implementing this is not worth the effort.