Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » [MacOS X.3.6] laucnching an swt app using Info.plist
[MacOS X.3.6] laucnching an swt app using Info.plist [message #446260] Mon, 22 November 2004 22:29 Go to next message
Eclipse UserFriend
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
solved )) was ([MacOS X.3.6] laucnching an swt app using Info.plist) [message #446263 is a reply to message #446260] Tue, 23 November 2004 00:07 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: yvon_thoraval.mac.com

Yvon Thoraval a écrit :

solved by putting my database into user home.

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 17:42 Go to previous messageGo to next message
Andre Weinand is currently offline Andre WeinandFriend
Messages: 66
Registered: July 2009
Member
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 #446728 is a reply to message #446727] Wed, 01 December 2004 17:55 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: thoraval.yvon.free.fr

Andre Weinand <andre_weinand@ch.ibm.com> wrote:

>
> Now should have a double clickable standalone application.

Thanks for your answer, it's exactly what i did, then, by your answer
means that the bug report #40178 not only has been solved but resolved
in the eclipse 3.1 M3 version ?

no more need of java_swt now my must and can make use of
JavaApplicationStub ???

In fact the situation isn't clear for me because i've discovered wheb
doing an export and launching my app outside of eclipse leads to a file
problem of unknown reason.

If changing the file by restarting my exported app within another Main
class, the app is workin fine with a fresh database file...

Then if "JavaApplicationStub" is the way to work on MacOS X even for swt
apps, by prob might not be related to eclipse export right ?
Re: [MacOS X.3.6] laucnching an swt app using Info.plist [message #446729 is a reply to message #446727] Wed, 01 December 2004 18:05 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: thoraval.yvon.free.fr

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 #446732 is a reply to message #446729] Wed, 01 December 2004 21:00 Go to previous messageGo to next message
Andre Weinand is currently offline Andre WeinandFriend
Messages: 1
Registered: July 2009
Junior Member
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 #446737 is a reply to message #446732] Thu, 02 December 2004 00:11 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: thoraval.yvon.free.fr

Andre Weinand <weinand@acm.org> wrote:

> Before you can use the application bundle exporter you must have a
> *working launch config* !

That's obvious, my app worked fine on eclipse thought i recognized i had
a prob with a database file, when working outside of eclipse (the path
to this file is independant of eclipse workspace and set relative to ~/)
which i don't understand at the time being.

>
> 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.

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.

Probably i've learned the setup i used from too old posts...

I've tried to export the way you wroten just before and I should say it
workes straight and even that i had no prob with the database file i've
mentionned previously.

Thanks very much.
Re: [MacOS X.3.6] laucnching an swt app using Info.plist [message #446746 is a reply to message #446737] Thu, 02 December 2004 10:00 Go to previous message
Andre Weinand is currently offline Andre WeinandFriend
Messages: 66
Registered: July 2009
Member
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
Previous Topic:initial size of a tableviewer
Next Topic:Resizing a JPanel within a Frame
Goto Forum:
  


Current Time: Mon Oct 19 21:43:59 GMT 2020

Powered by FUDForum. Page generated in 0.02235 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top