Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » OS X + Swing + OSGi
OS X + Swing + OSGi [message #725514] Thu, 15 September 2011 03:18 Go to next message
justin is currently offline justinFriend
Messages: 4
Registered: September 2011
Junior Member
Hello,

I am trying to develop OSGi bundles that use Swing. I would like to use Eclipse for this, as I find the built-in equinox framework is great for testing purposes. However, I run into a problem when using Mac OS X (currently 10.7) and Java 1.6 with Eclipse 3.7 Cocoa 64-bit.

When I run using an OSGi Framework configuration, I get the following console output:

osgi> 2011-09-14 23:11:08.137 java[1801:407] [Java CocoaComponent compatibility mode]: Enabled
2011-09-14 23:11:08.137 java[1801:407] [Java CocoaComponent compatibility mode]: Setting timeout for SWT to 0.100000


The JFrame will appear behind Eclipse and I can not focus it. This is a huge problem as I need focus for listening to mouse/keyboard events.

After many hours of searching Google and looking at a couple Eclipse bug reports, I tried the following:

1. Removing "-ws ${target.ws}" from the program arguments in the launch configuration.
2. Adding "--launcher.secondThread" to the program arguments in the launch configuration.
3. Modifying the eclipse.ini to remove any reference to "-XstartOnFirstThread"
4. Adding "--launcher.secondThread" to eclipse.ini

By doing #1, the error message no longer appears but the JFrame fails to launch. In fact, I believe the bundle is stuck in "Starting" and never "Active".

So far, the only solution I have is to use the 32-bit Cocoa version of Eclipse.

This is a really frustrating issue, and for now I will use 32-bit Eclipse for this particular program, but I am hoping there is a better solution.

public class Activator implements BundleActivator {

	public void start(BundleContext context) throws Exception {
		JFrame f = new JFrame("Hello World");
		f.setSize(300,300);
		f.setVisible(true);
	}
	
	public void stop(BundleContext context) throws Exception {}
}
Re: OS X + Swing + OSGi [message #734391 is a reply to message #725514] Fri, 07 October 2011 15:50 Go to previous message
Missing name Missing name is currently offline Missing name Missing nameFriend
Messages: 2
Registered: October 2011
Junior Member
I'm seeing the exact same problem in our OSGi swing application.

Adding "--launcher.secondThread" to the program arguments in the launch configuration should solve the problem, but it doesn't. I think this option is simply broken, and this is a bug in eclipse.
Previous Topic:API baseline & target platform
Next Topic:Is the StyledText class Customizable of the editor plugin ?
Goto Forum:
  


Current Time: Wed Apr 24 16:41:31 GMT 2024

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

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

Back to the top