Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » OSX SWT NoClassDefFoundError
OSX SWT NoClassDefFoundError [message #440535] Wed, 04 August 2004 01:11 Go to next message
Michael Brown is currently offline Michael BrownFriend
Messages: 20
Registered: July 2009
Junior Member
I've got a Java/SWT app built with Eclipse 3.0 running on WinXP and Solaris.
Trying to run it on OSX gets me an exception when it first tries to do
anything in the SWT realm:
Exception... NoClassDefFoundError: org/eclipse/swt/internal/carbon/OS
at org.eclipse.swt.widgets.Display.<clinit>(Display.java:308)
I'm not sure what I need to do to get all the pieces in place so they can be
found.
Any suggestions?

It would probably help if I could find some documentation wrt SWT on OSX.
Someone recently mentioned an OSX SWT tutorial/guide, but didn't mention
where they found it. Can anyone provide some pointers to relavent docs,
including said tutorial?

I saw some mention of an OSX SWT problem where the poster was having
problems with the tutorial, but I don't recall what the problem was.
Someone suggested setting the classpath both for compile and execution (I
think). I don't see how/where to do this. Any clues?

BTW, I'm a complete novice at OSX, both as user and as developer. Haven't
done any Mac development since it was OS7. Not sure what Carbon is. But I
do have a fair bit of experience with Windows and several Unix-like boxes.

Thanks...


Mike
Re: OSX SWT NoClassDefFoundError [message #440539 is a reply to message #440535] Wed, 04 August 2004 08:08 Go to previous messageGo to next message
Brion Vibber is currently offline Brion VibberFriend
Messages: 21
Registered: July 2009
Junior Member
Michael Brown wrote:
> I've got a Java/SWT app built with Eclipse 3.0 running on WinXP and Solaris.
> Trying to run it on OSX gets me an exception when it first tries to do
> anything in the SWT realm:
> Exception... NoClassDefFoundError: org/eclipse/swt/internal/carbon/OS
> at org.eclipse.swt.widgets.Display.<clinit>(Display.java:308)
> I'm not sure what I need to do to get all the pieces in place so they can be
> found.
> Any suggestions?

Make sure you add swt-pi.jar to the classpath; the internal bits seem to
be split off there and it's not added by default in Eclipse for some
bizarre reason.

> I saw some mention of an OSX SWT problem where the poster was having
> problems with the tutorial, but I don't recall what the problem was.
> Someone suggested setting the classpath both for compile and execution (I
> think). I don't see how/where to do this. Any clues?

Somewhere in the 'run' setup dialog. I can't understand anything in
there and just push buttons at random until something happens. ;)

(I don't really use Eclipse; the only SWT app I work on is built from ant.)

-- brion vibber (brion @ pobox.com)
Re: OSX SWT NoClassDefFoundError [message #440603 is a reply to message #440539] Wed, 04 August 2004 21:25 Go to previous messageGo to next message
Michael Brown is currently offline Michael BrownFriend
Messages: 20
Registered: July 2009
Junior Member
"Brion Vibber" <brion@pobox.com> wrote in message
news:ceq5ef$li2$1@eclipse.org...
> Michael Brown wrote:
> > I've got a Java/SWT app built with Eclipse 3.0 running on WinXP and
Solaris.
> > Trying to run it on OSX gets me an exception when it first tries to do
> > anything in the SWT realm:
> > Exception... NoClassDefFoundError:
org/eclipse/swt/internal/carbon/OS
> > at org.eclipse.swt.widgets.Display.<clinit>(Display.java:308)
> > I'm not sure what I need to do to get all the pieces in place so they
can be
> > found.
> > Any suggestions?
>
> Make sure you add swt-pi.jar to the classpath; the internal bits seem to
> be split off there and it's not added by default in Eclipse for some
> bizarre reason.
>
> > I saw some mention of an OSX SWT problem where the poster was having
> > problems with the tutorial, but I don't recall what the problem was.
> > Someone suggested setting the classpath both for compile and execution
(I
> > think). I don't see how/where to do this. Any clues?
>
> Somewhere in the 'run' setup dialog. I can't understand anything in
> there and just push buttons at random until something happens. ;)
>
> (I don't really use Eclipse; the only SWT app I work on is built from
ant.)
>
> -- brion vibber (brion @ pobox.com)

OK, thanks. I added swt-pi.jar to the jar manifest class path and now I've
got the basic dialog appearing. But nothing happens after that. Dialog
text box not being filled in at run time, no response to mouse. Suspect an
event loop problem?

Do I need to use the java_swt file from the OSX SWT distrib? Haven't found
any docs, so tried using it on the command line in place of java, e.g.:
java_swt -Djava.library.path=. -jar motd.jar
No joy, get a NoClassDefFound for motd/jar. Am I doing this wrong, does
java_swt not understand jars, am I completely confused?

Mike
Re: OSX SWT NoClassDefFoundError [message #440970 is a reply to message #440603] Mon, 09 August 2004 15:13 Go to previous messageGo to next message
Andreas Niemeyer is currently offline Andreas NiemeyerFriend
Messages: 40
Registered: July 2009
Member
Hi Mike,

there exists a detailed workaround in the bug corner of eclipse.

Please read:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=40003

Regards,
Andreas

Michael Brown wrote:
> "Brion Vibber" <brion@pobox.com> wrote in message
> news:ceq5ef$li2$1@eclipse.org...
>
>>Michael Brown wrote:
>>
>>>I've got a Java/SWT app built with Eclipse 3.0 running on WinXP and
>
> Solaris.
>
>>>Trying to run it on OSX gets me an exception when it first tries to do
>>>anything in the SWT realm:
>>> Exception... NoClassDefFoundError:
>
> org/eclipse/swt/internal/carbon/OS
>
>>> at org.eclipse.swt.widgets.Display.<clinit>(Display.java:308)
>>>I'm not sure what I need to do to get all the pieces in place so they
>
> can be
>
>>>found.
>>>Any suggestions?
>>
>>Make sure you add swt-pi.jar to the classpath; the internal bits seem to
>>be split off there and it's not added by default in Eclipse for some
>>bizarre reason.
>>
>>
>>>I saw some mention of an OSX SWT problem where the poster was having
>>>problems with the tutorial, but I don't recall what the problem was.
>>>Someone suggested setting the classpath both for compile and execution
>
> (I
>
>>>think). I don't see how/where to do this. Any clues?
>>
>>Somewhere in the 'run' setup dialog. I can't understand anything in
>>there and just push buttons at random until something happens. ;)
>>
>>(I don't really use Eclipse; the only SWT app I work on is built from
>
> ant.)
>
>>-- brion vibber (brion @ pobox.com)
>
>
> OK, thanks. I added swt-pi.jar to the jar manifest class path and now I've
> got the basic dialog appearing. But nothing happens after that. Dialog
> text box not being filled in at run time, no response to mouse. Suspect an
> event loop problem?
>
> Do I need to use the java_swt file from the OSX SWT distrib? Haven't found
> any docs, so tried using it on the command line in place of java, e.g.:
> java_swt -Djava.library.path=. -jar motd.jar
> No joy, get a NoClassDefFound for motd/jar. Am I doing this wrong, does
> java_swt not understand jars, am I completely confused?
>
> Mike
>
>
Re: OSX SWT NoClassDefFoundError [message #441269 is a reply to message #440970] Thu, 12 August 2004 20:42 Go to previous messageGo to next message
Michael Brown is currently offline Michael BrownFriend
Messages: 20
Registered: July 2009
Junior Member
Thanks. I've got it working now.

BTW, discovered that java_swt is not quite like java, specifically it
doesn't deal with the -jar command line flag.

This does not work:
java_swt -jar motd.jar
This does work:
java_swt -classpath motd.jar Motd

Mike


"Andreas Niemeyer" <andreas.niemeyer@gutzmann.com> wrote in message
news:cf8467$giu$1@eclipse.org...
> Hi Mike,
>
> there exists a detailed workaround in the bug corner of eclipse.
>
> Please read:
>
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=40003
>
> Regards,
> Andreas
>
> Michael Brown wrote:
> > "Brion Vibber" <brion@pobox.com> wrote in message
> > news:ceq5ef$li2$1@eclipse.org...
> >
> >>Michael Brown wrote:
> >>
> >>>I've got a Java/SWT app built with Eclipse 3.0 running on WinXP and
> >
> > Solaris.
> >
> >>>Trying to run it on OSX gets me an exception when it first tries to do
> >>>anything in the SWT realm:
> >>> Exception... NoClassDefFoundError:
> >
> > org/eclipse/swt/internal/carbon/OS
> >
> >>> at org.eclipse.swt.widgets.Display.<clinit>(Display.java:308)
> >>>I'm not sure what I need to do to get all the pieces in place so they
> >
> > can be
> >
> >>>found.
> >>>Any suggestions?
> >>
> >>Make sure you add swt-pi.jar to the classpath; the internal bits seem to
> >>be split off there and it's not added by default in Eclipse for some
> >>bizarre reason.
> >>
> >>
> >>>I saw some mention of an OSX SWT problem where the poster was having
> >>>problems with the tutorial, but I don't recall what the problem was.
> >>>Someone suggested setting the classpath both for compile and execution
> >
> > (I
> >
> >>>think). I don't see how/where to do this. Any clues?
> >>
> >>Somewhere in the 'run' setup dialog. I can't understand anything in
> >>there and just push buttons at random until something happens. ;)
> >>
> >>(I don't really use Eclipse; the only SWT app I work on is built from
> >
> > ant.)
> >
> >>-- brion vibber (brion @ pobox.com)
> >
> >
> > OK, thanks. I added swt-pi.jar to the jar manifest class path and now
I've
> > got the basic dialog appearing. But nothing happens after that. Dialog
> > text box not being filled in at run time, no response to mouse. Suspect
an
> > event loop problem?
> >
> > Do I need to use the java_swt file from the OSX SWT distrib? Haven't
found
> > any docs, so tried using it on the command line in place of java, e.g.:
> > java_swt -Djava.library.path=. -jar motd.jar
> > No joy, get a NoClassDefFound for motd/jar. Am I doing this wrong, does
> > java_swt not understand jars, am I completely confused?
> >
> > Mike
> >
> >
Re: OSX SWT NoClassDefFoundError [message #442153 is a reply to message #440535] Fri, 27 August 2004 23:13 Go to previous message
Eclipse UserFriend
Originally posted by: p.thibault.bigfoot.com

In article <cepd1p$ku4$1@eclipse.org>, "Michael Brown" <mab@purdue.edu>
wrote:

> I saw some mention of an OSX SWT problem where the poster was having
> problems with the tutorial, but I don't recall what the problem was.
> Someone suggested setting the classpath both for compile and execution (I
> think). I don't see how/where to do this. Any clues?

I had a problem with the tutorial because my Eclipse folder was renamed
"eclipse 3" and this was adding a space in the path that was interpreted
as a separator. It was the only problem that I had with the tutorial on
OS X.

------------------------
Pierre
Previous Topic:Help: DialogCellEditor does not work properly
Next Topic:SWT for MacOS X
Goto Forum:
  


Current Time: Wed Apr 24 23:46:42 GMT 2024

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

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

Back to the top