Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » OS X: launcher inside .app
OS X: launcher inside .app [message #723454] Thu, 08 September 2011 15:22 Go to next message
Thomas Singer is currently offline Thomas SingerFriend
Messages: 75
Registered: July 2009
Member
For AWT/Swing applications one usually uses the JavaApplicationStub to launch. For SWT applications we need to use the VM option -XstartOnFirstThread. According to my tests this seems not to work when using JavaApplicationStub and passing this option in the Info.plist (tried similar to the -Xmx option). Hence I'm now using a plain shell script.

Is that the correct way of launching an SWT application on OS X?

[Updated on: Thu, 08 September 2011 15:23]

Report message to a moderator

Re: OS X: launcher inside .app [message #724449 is a reply to message #723454] Mon, 12 September 2011 11:45 Go to previous messageGo to next message
Thomas Singer is currently offline Thomas SingerFriend
Messages: 75
Registered: July 2009
Member
Does none has an idea?
Re: OS X: launcher inside .app [message #724452 is a reply to message #723454] Mon, 12 September 2011 11:52 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by:

On 2011-09-08 17:22, Thomas Singer wrote:
> For AWT/Swing applications one usually uses the JavaApplicationStub to
> launch. For SWT applications we need to use the VM option
> -XstartOnFirstThread. According to my tests this seems not to work when
> using JavaApplicationStub and passing this option in the Info.plist
> (tried similar to the -Xmx option). Hence I'm now using a plain shell
> script. Is that the correct way of launching an SWT application on OS X?

I have *no* experience with MacOS and SWT, but does this possibly help:

http://www.digitalsanctuary.com/tech-blog/java/eclipse-startonfirstthread-error-and-fix.html

http://bineshgummadi.com/node/11

?

Greetings from Bremen,

Daniel Kr├╝gler
Re: OS X: launcher inside .app [message #724792 is a reply to message #724452] Tue, 13 September 2011 07:33 Go to previous messageGo to next message
Thomas Singer is currently offline Thomas SingerFriend
Messages: 75
Registered: July 2009
Member
Eclipse User wrote on Mon, 12 September 2011 07:52
Originally posted by:I have *no* experience with MacOS and SWT, but does this possibly help:

http://www.digitalsanctuary.com/tech-blog/java/eclipse-startonfirstthread-error-and-fix.html

http://bineshgummadi.com/node/11

Unfortunately, no, because it looks like AWT related.
Re: OS X: launcher inside .app [message #726191 is a reply to message #723454] Fri, 16 September 2011 18:25 Go to previous messageGo to next message
Bernhard Pieber is currently offline Bernhard PieberFriend
Messages: 11
Registered: July 2009
Junior Member
Am 08.09.11 17:22, schrieb Thomas Singer:
> For AWT/Swing applications one usually uses the JavaApplicationStub to
> launch. For SWT applications we need to use the VM option
> -XstartOnFirstThread. According to my tests this seems not to work when
> using JavaApplicationStub and passing this option in the Info.plist
> (tried similar to the -Xmx option). Hence I'm now using a plain shell
> script. Is that the correct way of launching an SWT application on OS X?
Maybe this link helps:
http://eclipse.org/swt/macosx/

Disclaimer: I have never tried it myself.

Cheers,
Bernhard
Re: OS X: launcher inside .app [message #726194 is a reply to message #726191] Fri, 16 September 2011 18:50 Go to previous messageGo to next message
Thomas Singer is currently offline Thomas SingerFriend
Messages: 75
Registered: July 2009
Member
Bernhard Pieber wrote on Fri, 16 September 2011 14:25
Maybe this link helps:
http://eclipse.org/swt/macosx/


That's what I'm currently doing, but I'm not sure whether this still is the officially suggested way to do it, especially because Apple promotes the JavaApplicationStub - at least for AWT/Swing.
Re: OS X: launcher inside .app [message #728553 is a reply to message #726194] Fri, 23 September 2011 13:22 Go to previous messageGo to next message
Lakshmi ShanmugamFriend
Messages: 274
Registered: July 2009
Location: India
Senior Member
Eclipse provides a way to create a Mac application bundle from a Java project.
Right click on project > Export > other > Mac OSX Application Bundle. In the wizard page, select the checkbox "Use SWT" and fill in the other details. The app bundle is created automatically.
(Sorry, I didn't remember this before Sad )


Lakshmi P Shanmugam
Re: OS X: launcher inside .app [message #734284 is a reply to message #728553] Fri, 07 October 2011 11:34 Go to previous messageGo to next message
Thomas Singer is currently offline Thomas SingerFriend
Messages: 75
Registered: July 2009
Member
Lakshmi Shanmugam wrote on Fri, 23 September 2011 09:22
Eclipse provides a way to create a Mac application bundle from a Java project.
Right click on project > Export > other > Mac OSX Application Bundle. In the wizard page, select the checkbox "Use SWT" and fill in the other details. The app bundle is created automatically.
(Sorry, I didn't remember this before Sad )

Unfortunately, there is no "other" category visible in my Export wizard. I've downloaded "Eclipse IDE for Java Developers" and created a small test project with SWT code.
Re: OS X: launcher inside .app [message #735242 is a reply to message #734284] Tue, 11 October 2011 10:09 Go to previous messageGo to next message
Lakshmi ShanmugamFriend
Messages: 274
Registered: July 2009
Location: India
Senior Member
I tried the "Eclipse IDE for Java Developers" 3.7.1 version and the export wizard does have the other category (tried File > Export... )

Lakshmi P Shanmugam
Re: OS X: launcher inside .app [message #735569 is a reply to message #735242] Wed, 12 October 2011 08:56 Go to previous messageGo to next message
Thomas Singer is currently offline Thomas SingerFriend
Messages: 75
Registered: July 2009
Member
Lakshmi Shanmugam wrote on Tue, 11 October 2011 06:09
I tried the "Eclipse IDE for Java Developers" 3.7.1 version and the export wizard does have the other category (tried File > Export... )

Sorry, I've downloaded a fresh copy of eclipse-java-indigo-SR1-win32.zip and when I invoke File -> Export there is no Other node. Maybe you have installed some additional plugins I don't have?
Re: OS X: launcher inside .app [message #735640 is a reply to message #735569] Wed, 12 October 2011 13:13 Go to previous messageGo to next message
Lakshmi ShanmugamFriend
Messages: 274
Registered: July 2009
Location: India
Senior Member
Thomas Singer wrote on Wed, 12 October 2011 14:26

I've downloaded a fresh copy of eclipse-java-indigo-SR1-win32.zip

This is a mac only feature, can you try with the mac-cocoa eclipse download?


Lakshmi P Shanmugam
Re: OS X: launcher inside .app [message #735679 is a reply to message #735640] Wed, 12 October 2011 14:34 Go to previous messageGo to next message
Thomas Singer is currently offline Thomas SingerFriend
Messages: 75
Registered: July 2009
Member
Lakshmi Shanmugam wrote on Wed, 12 October 2011 09:13
Thomas Singer wrote on Wed, 12 October 2011 14:26

I've downloaded a fresh copy of eclipse-java-indigo-SR1-win32.zip

This is a mac only feature, can you try with the mac-cocoa eclipse download?

You are right, this feature is available in OS-X-Eclipse. Unfortunately, the result looks very basic: I've got just following directory structure

Test.app/
[-] Contents
   [-] MacOS
   PkgInfo


That's it. Nothing in the MacOS directory, no Info.plist, no library (though I told it to use my launch configuration).

[Updated on: Wed, 12 October 2011 14:34]

Report message to a moderator

Re: OS X: launcher inside .app [message #736988 is a reply to message #735679] Fri, 14 October 2011 14:43 Go to previous messageGo to next message
Lakshmi ShanmugamFriend
Messages: 274
Registered: July 2009
Location: India
Senior Member
I exported a SWT project as a Mac application and it got created fine with Info.plist and the jars.

directory structure using ls -R Test.app
-----------------
Contents

Test.app/Contents:
Info.plist MacOS PkgInfo Resources

Test.app/Contents/MacOS:
JavaApplicationStub

Test.app/Contents/Resources:
Java

Test.app/Contents/Resources/Java:
jar_0.jar org.eclipse.swt.cocoa.macosx_3.8.0.v3800d.jar
--------------------

-You need check the "use SWT" checkbox and provide the correct run configuration.
-In the "Classpath and Libraries" page in the export wizard lists the jars & folder that will be added to the classpath.


Lakshmi P Shanmugam
Re: OS X: launcher inside .app [message #737134 is a reply to message #723454] Fri, 14 October 2011 17:48 Go to previous messageGo to next message
Thomas Singer is currently offline Thomas SingerFriend
Messages: 75
Registered: July 2009
Member
First, thanks for your continuing effort. To shorten the thread, could you please post the content of the generated Info.plist (assuming that the application starts fine)? Thanks in advance.
Re: OS X: launcher inside .app [message #739654 is a reply to message #737134] Mon, 17 October 2011 17:50 Go to previous messageGo to next message
Lakshmi ShanmugamFriend
Messages: 274
Registered: July 2009
Location: India
Senior Member
Attached the Info.plist here...
I'm still curious why the export mechanism is not working for you?!
  • Attachment: Info.plist
    (Size: 1.33KB, Downloaded 82 times)


Lakshmi P Shanmugam
Re: OS X: launcher inside .app [message #740127 is a reply to message #739654] Tue, 18 October 2011 07:26 Go to previous message
Thomas Singer is currently offline Thomas SingerFriend
Messages: 75
Registered: July 2009
Member
Lakshmi Shanmugam wrote on Mon, 17 October 2011 13:50
Attached the Info.plist here...

Thanks. How to add the command line parameter -d32, too?

Lakshmi Shanmugam wrote on Mon, 17 October 2011 13:50
I'm still curious why the export mechanism is not working for you?!

I've tried again. Please see following screenshots.
index.php/fa/4395/0/
index.php/fa/4396/0/
index.php/fa/4397/0/
index.php/fa/4398/0/
index.php/fa/4399/0/
Please note following bugs:
- the "Use this launch configuration" combobox is too narrow
- selecting the item from the "Use this launch configuration" combobox does not pick any main class or classpath entry
- clicking the "Search" button right beside the Main class input field does nothing
Previous Topic:TAB as global shortcut key
Next Topic:Question about "deferred events"
Goto Forum:
  


Current Time: Fri Nov 28 14:51:19 GMT 2014

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

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