Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Problem with Swing application plug-in on Mac OS X
Problem with Swing application plug-in on Mac OS X [message #453844] Mon, 11 April 2005 21:01 Go to next message
Harold Mills is currently offline Harold MillsFriend
Messages: 9
Registered: July 2009
Junior Member
I have an existing Swing application that I want to add plug-in capability
to. The near-term plan is to repackage most of it as an Eclipse
application plug-in (extending the org.eclipse.core.runtime.applications
extension point), and other parts as extensions to new extension points
that that plug-in defines.

This works fine on Windows. I can run my new plug-ins with a subset of the
RCP consisting of the org.eclipse.core.runtime and org.eclipse.osgi
plug-ins, either as an Eclipse application from within Eclipse or after
export. However, I have run into a problem on the Macintosh. When I try to
run my application from within Eclipse, the run fails with the console
message:

2005-04-05 13:33:34.475 java[359] Apple AWT Java VM was loaded on first
thread -- can't start AWT.

The error log for the run indicates that a java.lang.InternalError was
thrown in the native java.lang.ClassLoader$NativeLibrary.load method.

How can I fix this? Googling for the error message text shows that this
error occurs when one tries to use both AWT and SWT in the same
application on the Macintosh, but (as far as I know) this is not what I'm
attempting: my application does not use SWT at all.

I posted the above portion of this message to the RCP newsgroup last week,
and Pascal Rapicault suggested that I try removing -XstartOnFirstThread
from my Eclipse Info.plist. I did this, and it didn't help. I get the same
error message when I try to run my application, besides which the change
seems to make the Eclipse user interface intermittently unresponsive.

Thank you,

    Harold Mills
    Bioacoustics Research Program
    Cornell Lab of Ornithology
Re: Problem with Swing application plug-in on Mac OS X [message #453850 is a reply to message #453844] Tue, 12 April 2005 08:15 Go to previous messageGo to next message
Peter Goetz is currently offline Peter GoetzFriend
Messages: 38
Registered: July 2009
Member
Hi Harold,

Harold Mills wrote:
> [...]
> 2005-04-05 13:33:34.475 java[359] Apple AWT Java VM was loaded on first
> thread -- can't start AWT.
> [...]
> How can I fix this? Googling for the error message text shows that this
> error occurs when one tries to use both AWT and SWT in the same
> application on the Macintosh, but (as far as I know) this is not what
> I'm attempting: my application does not use SWT at all.
>

If I understand you right, you are not using SWT in your plug-in, but
Eclipse uses SWT. And your Plug-in runs inside Eclipse, so this error
occurs.
So far, there is no fix to this problem, we have to wait if Apple fixes
their VM.

> Thank you,
>

Peter

> Harold Mills
> Bioacoustics Research Program
> Cornell Lab of Ornithology
>
>
Re: Problem with Swing application plug-in on Mac OS X [message #453862 is a reply to message #453850] Tue, 12 April 2005 15:55 Go to previous messageGo to next message
Harold Mills is currently offline Harold MillsFriend
Messages: 9
Registered: July 2009
Junior Member
Thanks for your reply to my question. My plug-in is an application
extension. When I create a configuration to run my plug-in as an Eclipse
application, Eclipse tells me (on the "Plug-ins" tab of the "Run" dialog)
that the only other required plug-ins are org.eclipse.core.runtime and
org.eclipse.osgi. So SWT is not required either by my plug-in or by any of
the Eclipse plug-ins that it requires.

I have assumed that this should make it possible to run my application
from within Eclipse, just like when I used to run it as a Java application
before repackaging it as a plug-in. Eclipse presumably runs Java
applications as separate processes, since it successfully avoids the
SWT/AWT UI thread problem there. Does it not run Eclipse applications as
separate processes?

Perhaps Eclipse doees run an Eclipse application as a separate process,
but always starts Java on the first thread of the process, assuming that
the application will use SWT. If this is indeed what's happening, is there
some way to make Eclipse not do it for my application? I see no option in
the "Run" dialog for specifying this in my configuration.

Harold Mills
Bioacoustics Research Program
Cornell Lab of Ornithology
Re: Problem with Swing application plug-in on Mac OS X [message #453904 is a reply to message #453862] Wed, 13 April 2005 17:23 Go to previous message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
If it is running as a plugin, it is running in the same process and has the
interop problem. To track progress on the SWT_AWT on Mac issue, add
yourself to this bug report:

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

"Harold Mills" <hgm1@cornell.edu> wrote in message
news:c8eafd8069a0e392e606751e23549704$1@www.eclipse.org...
> Thanks for your reply to my question. My plug-in is an application
> extension. When I create a configuration to run my plug-in as an Eclipse
> application, Eclipse tells me (on the "Plug-ins" tab of the "Run" dialog)
> that the only other required plug-ins are org.eclipse.core.runtime and
> org.eclipse.osgi. So SWT is not required either by my plug-in or by any of
> the Eclipse plug-ins that it requires.
>
> I have assumed that this should make it possible to run my application
> from within Eclipse, just like when I used to run it as a Java application
> before repackaging it as a plug-in. Eclipse presumably runs Java
> applications as separate processes, since it successfully avoids the
> SWT/AWT UI thread problem there. Does it not run Eclipse applications as
> separate processes?
>
> Perhaps Eclipse doees run an Eclipse application as a separate process,
> but always starts Java on the first thread of the process, assuming that
> the application will use SWT. If this is indeed what's happening, is there
> some way to make Eclipse not do it for my application? I see no option in
> the "Run" dialog for specifying this in my configuration.
>
> Harold Mills
> Bioacoustics Research Program
> Cornell Lab of Ornithology
>
>
Previous Topic:CTabFolder minimize
Next Topic:negative values in spinner?
Goto Forum:
  


Current Time: Sat Mar 06 06:44:51 GMT 2021

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

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

Back to the top