That necessitated a few changes to the build.xml file: make the os "macosx", add an URL for the macos x86_64 version of swt (the one you have in there is 32 bit), install JavaCC and add the javacchome attributed to the javacc element, change the architecture on the dist-jar element for macosx to be 64-bit, change the dist.dir part of a fileset element to be a dir for macosx-x86_64, change the name of a tarfileset element to reflect 64 bit, and add a download-swt-jar element to fetch the 64-bit swt jar.
Diffs to the build.xml file are below. That took a few attempts to figure out, but one can't be too afraid of fiddling around to make stuff work.
Then I tried to build it, which actually succeeded with the altered build.xml file.
However, it does not launch. I'm new to the mac platform, so I can't guide you much here, but it looks like you're creating the Display somewhere other than in the main thread and the Cocoa implementation of SWT doesn't much care for that:
Code: Select all
$ java -jar dist/macosx-x86_64/pcm3.jar***WARNING: Display must be created on main thread due to Cocoa restrictions.Exception in thread "main" java.lang.ExceptionInInitializerError at pcm.gui.swt.SWTgui.<init>(SWTgui.java:41) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at java.lang.Class.newInstance0(Class.java:355) at java.lang.Class.newInstance(Class.java:308) at pcm.UI.guiFactory(UI.java:54) at pcm.UI.create(UI.java:74) at pcm.PCM.main(PCM.java:25)Caused by: org.eclipse.swt.SWTException: Invalid thread access at org.eclipse.swt.SWT.error(Unknown Source) at org.eclipse.swt.SWT.error(Unknown Source) at org.eclipse.swt.SWT.error(Unknown Source) at org.eclipse.swt.widgets.Display.error(Unknown Source) at org.eclipse.swt.widgets.Display.createDisplay(Unknown Source) at org.eclipse.swt.widgets.Display.create(Unknown Source) at org.eclipse.swt.graphics.Device.<init>(Unknown Source) at org.eclipse.swt.widgets.Display.<init>(Unknown Source) at org.eclipse.swt.widgets.Display.<init>(Unknown Source) at pcm.gui.swt.Global.<clinit>(Global.java:16) ... 10 more
Here are the build.xml diffs:
Code: Select all
$ diff build.xml~ build.xml8c8< <property name="os" value="linux" />---> <property name="os" value="macosx" />50a51,53> <property name="swt.macosx.x86_64.url" value="${eclipse.mirror}/eclipse/eclipse/downloads/drops/${eclipse.drop}/swt-${swt.version}-cocoa-macosx-x86_64.zip" />> <property name="swt.macosx.x86_64.zip" value="${downloads.dir}/swt-${swt.version}-cocoa-macosx-x86_64.zip" />> 69c72< <javacc target="${src.dir}/pcm/imp/parser/Parser.jj"/>---> <javacc target="${src.dir}/pcm/imp/parser/Parser.jj" javacchome="../javacc-5.0"/>150c153< <dist-jar os="macosx" arch="i386" />---> <dist-jar os="macosx" arch="x86_64" />156c159< <fileset dir="${dist.dir}/macosx-i386">---> <fileset dir="${dist.dir}/macosx-x86_64">174c177< <tarfileset dir="${basedir}/distfiles/macosx-i386" prefix="${bundle.name}" />---> <tarfileset dir="${basedir}/distfiles/macosx" prefix="${bundle.name}" />283a287> <download-swt-jar os="macosx" arch="x86_64" />