The one application instance only scheme of OS X can be an ache, especially when you do need to work on different workspaces simultaneously and the application at hand does not support it; such as Eclipse. The earliest mention of this problem with Eclipse I found in bug 139319; which was about starting multiple instances of Eclipse on OS X for exactly this purpose. Another related issue (bug 245339) was opened for the purpose of discussing a proper implementation of multi-workspace handling. The prior was closed as RESOLVED WONTFIX due to this.
Six years later Eclipse still cannot handle more than one workspace at a time – and OS X has become fairly popular. Thus several developers have had the same gripes and a few different solutions have come up:
- Using the open command from the shell.
- Playing around with Finder.
- Writing a shell script.
- Creating separate launchers
These solutions are all a bit cumbersome and require labour; so I set about to write a small plugin that remedies this by adding a Open Workspace menu item just as in the original request. It will detect the application of the running Eclipse instance and start another in a fashion similar to the Switch Workspace command.
Now with all these Eclipse instances up and running I figured it would be a good idea if one would be able to tell them apart by taking a look at the icon; so the workspace name will show up in the icon badge if set (Preferences > General > Workspace).
That’s all there’s to it. You’ll find the source code at GitHub and the installer at the Eclipse Marketplace – or you can drag into an running Eclipse instance.
Have you considered contributing your code to Eclipse, maybe as a patch for bug 25339? I'd be surprised if it wasn't welcomed (assuming you're willing to commit to supporting the code going forward).
Hi Eric. I did think about contributing to bug 139319. Of course, the proper way would be to fix bug 245339 by handling multiple workspaces within one Eclipse instance. In that respect this solution a bit of a kludge. It is not really a solution for the bug. What you do get is basically what Linux and Windows users have had all along; the ability to start multiple instances.
Hello Torkild,
Great Job !
It's seems that is easy to implements this functionality for the Win32 platform. You must just change how You get the application file (laucher). For the Win32, the laucher is already an .exe file. So the code can be:
if (Platform.getOS().equals(Platform.OS_WIN32)) {
return new File(launcher);
} else if (Platform.getOS().equals(Platform.OS_MACOSX)) {
…
}
Very cool plugin! I suggest this to become part of Eclipse itself 🙂
Thanks for the tip Bibi! I did think about adding a similar feature for Windows, but I did not think it worth the effort. Windows (and Linux) users can already easily start multiple instances of Eclipse using the application icon.
Thanks Marco! It could be added in the future, but some more refinement will be required.
Nice… I’m glad someone has made other developers life easier! Thanks Torkild
One of the best plugin for Eclipse/STS.
Trying to install and getting the following error in Luna:
Cannot complete the install because some dependencies are not satisfiable
no.resheim.eclipse.utils.launcher.feature.group [2.0.0.201411211032] cannot be installed in this environment because its filter is not applicable.
I have more than a hunch that you are not running Eclipse on OS X. Could that be the case? Sadly there is no support for running this plug-in on other operating systems yet. If you are on OS X please file a bug on the GitHib issue tracker and I’ll take a closer look.
Does this work on the latest Eclipse (Luna)? I just installed your plug-in from the marketplace and restarted Eclipse, but I don’t see an Open Workspace menu item… just the usual Switch Workspace. Thanks!
Yes it should work. Are you by a chance running Eclipse on anything older than Java 1.7?
I checked and it says Java 8 Update 31.
Strange. Would you mind filing a bug at the GitHub site and add your .log file? It might reveal what is going on.
Sure… but a question — where is the log file? I’m looking through the Eclipse dir right now and can’t find one to attach.
In your workspace there is a “.metadata” folder and within that you’ll find a file named “.log”.
Thanks, found the file. Created the issue but there doesn’t appear to be a way to attach it. Couldn’t paste it into the form because it’s too long. Dunno what to do with it.
You can reach me at torkildr at gmail.com.
Thank you, I used it with Spring Tool Suite Version: 3.5.1.RELEASE and it worked like a charm.
Thank you. With Eclipse Mars it’s easier to run multiple instances on OS/X than before, but this is cleaner and the label on the icon is a great improvement!
Thanks Adam. I’m glad you like it 🙂
This is just wonderful! Thanks for making our lives easier 🙂
This is awesome! Nice work!
Nice job!
Tried to download via Eclipse marketplace in Eclipse Oxygen for mac. The error thrown says that the repository https://resheim.net/p2/eclipse-launcher/content.xml not found. Is this plugin not supported anymore?
Hi. The problem was caused by the new Let’s Encrypt certificate I had installed. Looks OK now.
Thanks for the plugin! Very useful!
Any idea why the workspace badge does not stick? It just disappears just seconds after I open a new workspace…
Thanks David ? I’m quite certain the badge does not stick because you use a recent version of Eclipse that has Oomph installed. The latter will reset the badge if you have not explicitly set it. See https://github.com/turesheim/eclipse-launcher/issues/5279
I’m unable to install the plugin
I’m having the below error in the log
!MESSAGE Unable to read repository at https://resheim.net/p2/eclipse-launcher/content.xml.
!STACK 0
java.net.SocketTimeoutException: connect timed out
Looks good at my end. Maybe you’re having some intermittent connection issues? What version of Eclipse are you using?
GREAT JOB!!!
I am unable to install. I get the following error:
Unable to read repository at https://resheim.net/p2/eclipse-launcher/content.xml.
sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Looks like an SSL cert issue. Is this on your end or mine?
I did do an Apache upgrade yesterday and it appears the wrong certificate got picked up. Please try again.
I just tried and I’m getting the same SSL cert issue
I’m can’t install this plugin any more — Eclipse complains about the SSL certificate?
Yes, you must make sure you have a fairly recent Java version. See https://github.com/turesheim/eclipse-launcher/issues/5298
Thanks! I manually downloaded the zip from https://github.com/turesheim/eclipse-launcher/releases and installed that way.