[MacOS X.3.6] laucnching an swt app using Info.plist [message #446260] |
Mon, 22 November 2004 17:29  |
Eclipse User |
|
|
|
Originally posted by: yvon_thoraval.mac.com
Hy all,
i've tried to launch an swt app using Apple's Bundle and Info.plist and
wasn't unable to see something working.
I've found a workover with a ruby script giving the right java_swt
command and whatelse.
However i wonder if someone had success with Info.plist like that :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>java_swt</string>
<key>CFBundleGetInfoString</key>
<string>A02t_SodaLikeOnTreeTable1.0, Copyright {user} 2004. All
rights reserved.</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleIconFile</key>
<string>A02t_SodaLikeOnTreeTable.icns</string>
<key>CFBundleIdentifier</key>
<string>db4o</string>
<key>CFBundleName</key>
<string>A02t_SodaLikeOnTreeTable</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>yTho</string>
<key>CFBundleVersion</key>
<string>1.0.1</string>
<key>Java</key>
<dict>
<key>JVMVersion</key>
<string>1.4*</string>
<key>MainClass</key>
<string>yt.db4o.t.appellations.A02t_SodaLikeOnTreeTable</string >
<key>WorkingDirectory</key>
<string>Contents/Resources/Java</string>
<key>Arguments</key>
<array/>
<key>VMOptions</key>
<string>-Djava.library.path=$JAVAROOT/dll
-Dorg.eclipse.swt.internal.carbon.noFocusRing
-Dorg.eclipse.swt.internal.carbon.smallFonts</string>
<key>ClassPath</key>
<string> $JAVAROOT/jar_0.jar:$JAVAROOT/soda.jar:$JAVAROOT/swt.jar:$JA VAROOT/swt-pi.jar:$JAVAROOT/db4o-4.0-java1.4.jar:$JAVAROOT/j face.jar </string>
</dict>
</dict>
</plist>
My directory tree :
MyApp.app/contents/ :
MacOS/
java_swt
PkgInfo
Info.plist
Resources/
MyApp.icns
Java/
db4o-4.0-java1.4.jar
images.jar
[...]
swt.jar
swt-pi.jar
dll/
libswt-carbon-3111.jnilib
libswt-pi-carbon-3111.jnilib
libswt-webkit-carbon-3111.jnilib
At most, i've seen the app icon in the dock moving and then the app
"crash", is ther a way to get back some log info ?
Obviously the app is working from command line in the Bundle tree.
Any help appreciatd,
Yvon
|
|
|
|
Re: [MacOS X.3.6] laucnching an swt app using Info.plist [message #446727 is a reply to message #446260] |
Wed, 01 December 2004 12:42   |
Eclipse User |
|
|
|
Hi Yvon,
The easiest way to create a standalone SWT application is to use the "Mac OS
X Application bundle exporter":
- get your SWT/jface or AWT/Swing application to work within Eclipse,
that is create a named launch configuration that successfully launches
the application.
- select your application's project in the package explorer
- select "Export" from the context menu
- in the Export wizard select the "Mac OS X application bundle exporter"
- on the next page verify that the correct launch configuration is selected
in the popup menu. If not select the correct one.
- for the field "Folder" press the "Browse" button and select the
destination folder for your app.
- press "Finish"
Now should have a double clickable standalone application.
--andre
On 22.11.2004 23:29 Uhr, in article cntpa8$b98$1@www.eclipse.org, "Yvon
Thoraval" <yvon_thoraval@mac.com> wrote:
> Hy all,
>
> i've tried to launch an swt app using Apple's Bundle and Info.plist and
> wasn't unable to see something working.
>
> I've found a workover with a ruby script giving the right java_swt
> command and whatelse.
>
> However i wonder if someone had success with Info.plist like that :
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
> "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
> <plist version="1.0">
> <dict>
> <key>CFBundleExecutable</key>
> <string>java_swt</string>
> <key>CFBundleGetInfoString</key>
> <string>A02t_SodaLikeOnTreeTable1.0, Copyright {user} 2004. All
> rights reserved.</string>
> <key>CFBundleInfoDictionaryVersion</key>
> <string>6.0</string>
> <key>CFBundleIconFile</key>
> <string>A02t_SodaLikeOnTreeTable.icns</string>
> <key>CFBundleIdentifier</key>
> <string>db4o</string>
> <key>CFBundleName</key>
> <string>A02t_SodaLikeOnTreeTable</string>
> <key>CFBundlePackageType</key>
> <string>APPL</string>
> <key>CFBundleSignature</key>
> <string>yTho</string>
> <key>CFBundleVersion</key>
> <string>1.0.1</string>
> <key>Java</key>
> <dict>
> <key>JVMVersion</key>
> <string>1.4*</string>
> <key>MainClass</key>
>
> <string>yt.db4o.t.appellations.A02t_SodaLikeOnTreeTable</string >
> <key>WorkingDirectory</key>
> <string>Contents/Resources/Java</string>
> <key>Arguments</key>
> <array/>
> <key>VMOptions</key>
> <string>-Djava.library.path=$JAVAROOT/dll
> -Dorg.eclipse.swt.internal.carbon.noFocusRing
> -Dorg.eclipse.swt.internal.carbon.smallFonts</string>
> <key>ClassPath</key>
>
> <string> $JAVAROOT/jar_0.jar:$JAVAROOT/soda.jar:$JAVAROOT/swt.jar:$JA VAROOT/swt
> -pi.jar:$JAVAROOT/db4o-4.0-java1.4.jar:$JAVAROOT/jface.jar</string >
> </dict>
> </dict>
> </plist>
>
> My directory tree :
>
> MyApp.app/contents/ :
>
> MacOS/
> java_swt
> PkgInfo
> Info.plist
> Resources/
> MyApp.icns
> Java/
> db4o-4.0-java1.4.jar
> images.jar
> [...]
> swt.jar
> swt-pi.jar
> dll/
> libswt-carbon-3111.jnilib
> libswt-pi-carbon-3111.jnilib
> libswt-webkit-carbon-3111.jnilib
>
>
> At most, i've seen the app icon in the dock moving and then the app
> "crash", is ther a way to get back some log info ?
>
> Obviously the app is working from command line in the Bundle tree.
>
> Any help appreciatd,
>
> Yvon
|
|
|
|
|
Re: [MacOS X.3.6] laucnching an swt app using Info.plist [message #446732 is a reply to message #446729] |
Wed, 01 December 2004 16:00   |
Eclipse User |
|
|
|
As already mentioned in my original posting:
Before you can use the application bundle exporter you must have a
*working launch config* !
So yes, you'll have to specify a -Djava.library.path for SWT applications in
the launch configuration.
But this has nothing to do with java_swt the Mac or the bundle exporter.
It's just a requirement of SWT applications.
However, you don't have to setup a special "dll" folder. You can just
specify the folder that already exists in your Eclipse installation.
Or, you can checkout the org.eclipse.swt.carbon project from the Eclipse CVS
repository and the dll folder within that project to -Djava.library.path.
After you have done this, the application bundle exporter has all
information to build a standalone application bundle.
The only things you'll have to specify are the
- launch configuration
- the destination directory
Here is an example of a standalone SWT application that has been created via
the application bundle exporter. You can use it to find out what is
different in your case.
http://www.weinand.org/eclipse/ControlExample.dmg
--andre
> the only way i've found able to launch an swt app, even within eclipse,
> is to add in the project a folder "dll" having those files :
> java_swt
> libswt-carbon-3111.jnilib
> libswt-pi-carbon-3111.jnilib
> libswt-webkit-carbon-3111.jnilib
>
> and adding a VM Argument : -Djava.library.path=dll (in the run window
> tab/Arguments)
On 1.12.2004 19:05 Uhr, in article
1go4q5c.1kr2ehldcefczN%thoraval.yvon@free.fr, "Yvon Thoraval"
<thoraval.yvon@free.fr> wrote:
> Andre Weinand <andre_weinand@ch.ibm.com> wrote:
>
>>
>> Now should have a double clickable standalone application.
>
> i did this trial, however it doesn't work with swt apps, here is my
> console output showing it is an swr issue :
>
> [LaunchRunner Error]
> yt.db4o.appellations.ui.ShowAppellations.main(String[]) threw an
> exception:
>
> java.lang.UnsatisfiedLinkError: no swt-pi-carbon-3111 in
> java.library.path
>
> at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1517)
>
> at java.lang.Runtime.loadLibrary0(Runtime.java:788)
>
> at java.lang.System.loadLibrary(System.java:834)
>
> at
> org.eclipse.swt.internal.Library.loadLibrary(Library.java:10 0)
>
> at org.eclipse.swt.internal.carbon.OS.<clinit>(OS.java:22)
>
> at
> org.eclipse.swt.widgets.Display.createDisplay(Display.java:8 16)
>
> at org.eclipse.swt.widgets.Display.create(Display.java:796)
>
> at org.eclipse.swt.graphics.Device.<init>(Device.java:97)
>
> at org.eclipse.swt.widgets.Display.<init>(Display.java:637)
>
> at org.eclipse.swt.widgets.Display.<init>(Display.java:633)
>
> at
> yt.db4o.appellations.ui.ShowAppellations.buildGUI(ShowAppell ations.java:
> 139)
>
> at
> yt.db4o.appellations.ui.ShowAppellations.main(ShowAppellatio ns.java:117)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.jav
> a:39)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessor
> Impl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:324)
>
> at apple.launcher.LaunchRunner.run(LaunchRunner.java:88)
>
> at apple.launcher.LaunchRunner.callMain(LaunchRunner.java:50)
>
> at
> apple.launcher.JavaApplicationLauncher.launch(JavaApplicatio nLauncher.ja
> va:52)
>
> the only way i've found able to launch an swt app, even within eclipse,
> is to add in the project a folder "dll" having those files :
> java_swt
> libswt-carbon-3111.jnilib
> libswt-pi-carbon-3111.jnilib
> libswt-webkit-carbon-3111.jnilib
>
> and adding a VM Argument : -Djava.library.path=dll (in the run window
> tab/Arguments)
>
|
|
|
|
Re: [MacOS X.3.6] laucnching an swt app using Info.plist [message #446746 is a reply to message #446737] |
Thu, 02 December 2004 05:00  |
Eclipse User |
|
|
|
On 2.12.2004 1:11 Uhr, in article
1go5545.14znsml11wlhpjN%thoraval.yvon@free.fr, "Yvon Thoraval"
<thoraval.yvon@free.fr> wrote:
> i recognize also that in your case the Info.plist file comes directly
> from bundle exporter and their is no -Djava.library.path arg to the VM.
Yes, there is no need for an explicit -Djava.library.path as long as the
dlls are in the directory denoted by $JAVAROOT:
SomeApp.app/Contents/Resources/Java
This is the default value for java.library.path.
However, if you want to keep the dlls somewhere else, you'll have to specify
a java.library.path accordingly.
--andre
|
|
|
Powered by
FUDForum. Page generated in 0.36807 seconds