Frage

I have a SWT based Java application that works on Windows, Mac OS and Linux. I develop it on my Windows machine and have a tester with Linux and a tester with a Mac. Currently my process creates a runnable .jar file for each platform on my Windows machine (which references the platform specific .jar and lib files from Eclipse.org). I have a working installer for Windows - also produced by the build on the windows machine. I want to create a standard Mac OS installer for my Mac users. The right way to do that appears to be to create a .app bundle and distribute it via a dmg file. This has not being going well. I have a working Java app that uses SWT and can be run from the command line, on all platforms. I have a way of building a .dmg on Windows. But so far all my attempts to get a .app bundle to work have failed.

I started by following this tutorial: http://www.eclipse.org/swt/macosx/

But when running my application I get an error saying that applications for the Power PC are not supported. That is using the same binaries that work from the command line using java -jar so the problem must be in the the way I am bundling. The sample Hello app from the page also fails to work but with a different error message.

I have been searching all day and found this promising talk: http://www.parleys.com/#st=5&id=2891&sl=72

In that talk the speaker says there will be a way to create a Mac OS .app bundle on any platform using a standard java launcher. But I cannot find any such thing released yet.

I found this post that also looks promising: http://www.intransitione.com/blog/take-java-to-app-store/

But this recipe says it will not work except by building on a Mac OS machine.

What I want to do is create a .app bundle for Mac OS X on my windows machine along with the Windows install and the Linux install. It would be preferable to also include a jre as part of the app bundle (which I already have working for Windows and Linux). I hope someone can point me in the right direction.

War es hilfreich?

Lösung

Have you seen this?

The .app is just a directory with a special structure a few special files. Once you have it created, you'll only need to update the JAR each time you build, which can be found here: MyApp.app/Contents/Resources/Java/MyJar.jar.

There will also be a few Java-specific properties in My.app/Contents/Info.plist, but you probably won't need to change these from how you initially set them up.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top