Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » SWT on snow leopard osx 10.6 with older programs
SWT on snow leopard osx 10.6 with older programs [message #483961] Thu, 03 September 2009 18:26 Go to next message
John is currently offline JohnFriend
Messages: 52
Registered: July 2009
Member
If I have an older stand alone SWT program (uses swt carbom 3.509), are
there simple steps to get it to work on OSX 10.6 snow leapord? I don't use
OSX myself I am trying to help someone that does but says it no longer
works since updating to 10.6. I don't know if it is the swt carbon that is
the problem (does carbon still work on 10.6 or is cocoa really mandatory)
or is it the JVM version or 64 bit <-> 32bit swt that has become the
compatibility problem?

The application has always just worked by using the SWT recommended startup
script:

#!/bin/sh
BASEDIR=`dirname "$0"`
exec java -XstartOnFirstThread -classpath "$BASEDIR/app.jar:$BASEDIR" -
Djava.library.path="$BASEDIR/swt" my.main.Class

I've read about adding

<key>JVMArchs</key>
<string>i386</string>

to the Info.plist but not sure if that is right or would be enough to make
it work.

So, I'd like to know the correct way to get old SWT apps that used to work
on OSX to run again on 10.6 without having to completely rebuild them with
newer SWT versions if possible.
Re: SWT on snow leopard osx 10.6 with older programs [message #483973 is a reply to message #483961] Thu, 03 September 2009 19:20 Go to previous messageGo to next message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
Hi,

swt-carbon apps should still run on OSX 10.6 with a 32-bit JVM. My guess is
that you're getting the default 64-bit JVM since you're just exec'ing java.
Does adding switch -d32 help?

Grant


"John" <john@nospam.com> wrote in message
news:h7p1nu$af7$1@build.eclipse.org...
> If I have an older stand alone SWT program (uses swt carbom 3.509), are
> there simple steps to get it to work on OSX 10.6 snow leapord? I don't use
> OSX myself I am trying to help someone that does but says it no longer
> works since updating to 10.6. I don't know if it is the swt carbon that
is
> the problem (does carbon still work on 10.6 or is cocoa really mandatory)
> or is it the JVM version or 64 bit <-> 32bit swt that has become the
> compatibility problem?
>
> The application has always just worked by using the SWT recommended
startup
> script:
>
> #!/bin/sh
> BASEDIR=`dirname "$0"`
> exec java -XstartOnFirstThread -classpath "$BASEDIR/app.jar:$BASEDIR" -
> Djava.library.path="$BASEDIR/swt" my.main.Class
>
> I've read about adding
>
> <key>JVMArchs</key>
> <string>i386</string>
>
> to the Info.plist but not sure if that is right or would be enough to make
> it work.
>
> So, I'd like to know the correct way to get old SWT apps that used to work
> on OSX to run again on 10.6 without having to completely rebuild them with
> newer SWT versions if possible.
>
>
Re: SWT on snow leopard osx 10.6 with older programs [message #484295 is a reply to message #483973] Sat, 05 September 2009 17:28 Go to previous messageGo to next message
John is currently offline JohnFriend
Messages: 52
Registered: July 2009
Member
Yes, -d32 helps. Maybe it can be added to the website tutorial if that
parameter should be used all the time.

http://www.eclipse.org/swt/macosx/
"Launching the application" section:

(it also could use quotes around the paths, in case they have spaces in
them)


#!/bin/sh
BASEDIR=`dirname "$0"`
exec java -d32 -XstartOnFirstThread -classpath "$BASEDIR/sancho.jar:
$BASEDIR" -Djava.library.path="$BASEDIR/swt" SWTHello



"Grant Gayed" <grant_gayed@ca.ibm.com> wrote in
news:h7p4ur$26j$1@build.eclipse.org:

> Hi,
>
> swt-carbon apps should still run on OSX 10.6 with a 32-bit JVM. My
> guess is that you're getting the default 64-bit JVM since you're just
> exec'ing java. Does adding switch -d32 help?
>
> Grant
Re: SWT on snow leopard osx 10.6 with older programs [message #484296 is a reply to message #484295] Sat, 05 September 2009 17:31 Go to previous messageGo to next message
John is currently offline JohnFriend
Messages: 52
Registered: July 2009
Member
John <john@nospam.com> wrote in news:h7u74d$e2a$1@build.eclipse.org:

> Yes, -d32 helps. Maybe it can be added to the website tutorial if that
> parameter should be used all the time.
>
> http://www.eclipse.org/swt/macosx/
> "Launching the application" section:
>
> (it also could use quotes around the paths, in case they have spaces in
> them)

Correction from copy/paste error:

#!/bin/sh
BASEDIR="`dirname $0`"
exec java -d32 \
-XstartOnFirstThread \
-classpath "$BASEDIR/swt/swt.jar:$BASEDIR" \
SWTHello
Re: SWT on snow leopard osx 10.6 with older programs [message #484651 is a reply to message #484296] Tue, 08 September 2009 15:39 Go to previous message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
Thanks for pointing out this link, I've updated it and also added an entry
to the SWT FAQ.

Grant


"John" <john@nospam.com> wrote in message
news:h7u79s$e2a$2@build.eclipse.org...
> John <john@nospam.com> wrote in news:h7u74d$e2a$1@build.eclipse.org:
>
> > Yes, -d32 helps. Maybe it can be added to the website tutorial if that
> > parameter should be used all the time.
> >
> > http://www.eclipse.org/swt/macosx/
> > "Launching the application" section:
> >
> > (it also could use quotes around the paths, in case they have spaces in
> > them)
>
> Correction from copy/paste error:
>
> #!/bin/sh
> BASEDIR="`dirname $0`"
> exec java -d32 \
> -XstartOnFirstThread \
> -classpath "$BASEDIR/swt/swt.jar:$BASEDIR" \
> SWTHello
>
Previous Topic:Re: Bizarre issue with tab order in a ToolBar
Next Topic:Disable CheckboxTableViewer
Goto Forum:
  


Current Time: Thu Dec 05 14:22:06 GMT 2019

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

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

Back to the top