196

How can I open multiple Eclipse workspaces at the same time on the Mac?

On other platforms, I can just launch extra Eclipse instances, but the Mac will not let me open the same application twice. Is there a better way than keeping two copies of Eclipse?

Milhous
  • 14,003
  • 16
  • 60
  • 80
Thilo
  • 241,635
  • 91
  • 474
  • 626

20 Answers20

237

This seems to be the supported native method in OS X:

cd /Applications/eclipse/

open -n Eclipse.app

Be sure to specify the ".app" version (directory); in OS X Mountain Lion erroneously using the symbolic link such as open -n eclipse, might get one GateKeeper stopping access:

"eclipse" can't be opened because it is from an unidentified developer.

Your security preferences allow installation of only apps from the Mac App Store and identified developers.

Even removing the extended attribute com.apple.quarantine does not fix that. Instead, simply using the ".app" version will rely on your previous consent, or prompt you once:

"Eclipse" is an application downloaded from the Internet. Are you sure you want to open it?

Community
  • 1
  • 1
Milhous
  • 14,003
  • 16
  • 60
  • 80
179

By far the best solution is the OSX Eclipse Launcher presented in http://torkild.resheim.no/2012/08/opening-multiple-eclipse-instances-on.html It can be downloaded in the Marketplace http://marketplace.eclipse.org/content/osx-eclipse-launcher#.UGWfRRjCaHk

I use it everyday and like it very much! To demonstrate the simplicity of usage just take a look at the following image:

Image demonstrating the plugin usage: Just go File / Open Workspace / select one

col.panic
  • 2,808
  • 4
  • 22
  • 30
  • 13
    Nice. It even adds a nice badge to the Dock icon(s), and to the icons in the task switcher. Perfect! – Arjan Dec 01 '12 at 11:31
  • 7
    This is by far the easiest solution to implement and best addresses the spirit of the question. The other answers seem to be scored higher based on their age alone. – Louth May 30 '13 at 01:52
  • This is easily the way to go. If you always start multiple instances you could script that into the CLI. But if it's just on occasion you start another instance, this is the way to go. – Bane May 28 '14 at 16:14
  • Nice! Even if the `Launch New Workspace` isn't visible in Eclipse `ADT` (Android Developer Tools), but it opens a second workspace if you choose `Open Workspace` – longi Jun 16 '14 at 14:00
  • A really nice feature to Eclipse! I only have "Open Workspace" option in the menu after installed the plugin but it is possible to create a new workspace by choosing "Other..." anyway. I wonder if there is any similar plugin to Windows version...? – tftdias Jun 27 '14 at 14:33
  • Was really excited by this, but it didn't work for me. 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. – kfox Jan 28 '15 at 19:10
  • @kfox This is typically an indicator of a platform/ui/arch mismatch. What are you running? – torkildr Mar 30 '15 at 21:52
  • @torkildr I'm running Eclipse IDE for Java Developers Version: Luna Service Release 1a (4.4.1) Build id: 20150109-0600 OSX Yosemite 10.10.2 – kfox Mar 31 '15 at 18:46
  • Here is the error that's displayed: 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. – kfox Mar 31 '15 at 22:02
  • 2
    I suspect you're not running Eclipse on Java 7 or better. – torkildr Apr 21 '15 at 07:40
  • This is a nice plugin – Mark.ewd Jan 07 '16 at 22:29
  • 6
    Here's the current link to the updated plugin: https://marketplace.eclipse.org/content/os-x-eclipse-launcher ..especially relevant because searching on Eclipse's marketplace website right now leads to an infinite redirect... (sigh) – chaqke Feb 18 '16 at 19:44
  • Great plugin! Any idea why the dock badge does not stay? I see it for just a second when I launch new eclipse instance, but then it disappears. – duduamar Mar 10 '17 at 21:16
  • This works like a charm. There are some old comments on market place which says it didnt work, but looks like after recent update all good. Tried with latest java 8 update, latest mac high sierra (10.13.4), Eclipse latest Oxygen 3.a PS: Ya Mac window management is amazing, you need a separate utility just to open two instances of same app. :( – AmitM Apr 20 '18 at 05:26
  • Freakin' awesome! I was just thinking it would be great to add the badge with the workspace (I use 4 at once at the moment). I have also just implemented this myself for my java mac desktop application. I googled and hey presto! Like magic. :) "Open Workspace" menu might even be considered as a standard eclipse menu. – Nick May 23 '20 at 08:31
  • WIsh I could have given multiple +++ for this :) Thank you!! – Karthik Jan 01 '21 at 18:46
177

EDIT: Milhous's answer seems to be the officially supported way to do this as of 10.5. Earlier version of OS X and even 10.5 and up should still work using the following instructions though.


  1. Open the command line (Terminal)

  2. Navigate to your Eclipse installation folder, for instance:

    • cd /Applications/eclipse/
    • cd /Developer/Eclipse/Eclipse.app/Contents/MacOS/eclipse
    • cd /Applications/eclipse/Eclipse.app/Contents/MacOS/eclipse
    • cd /Users/<usernamehere>/eclipse/jee-neon/Eclipse.app/Contents/MacOS
  3. Launch Eclipse: ./eclipse &

This last command will launch eclipse and immediately background the process.

Rinse and repeat to open as many unique instances of Eclipse as you want.


Warning

You might have to change the Tomcat server ports in order to run your project in different/multiple Tomcat instances, see Tomcat Server Error - Port 8080 already in use

Community
  • 1
  • 1
Tim Visher
  • 12,438
  • 16
  • 55
  • 66
  • true, but the OP mentions Mac. – Milhous Dec 23 '08 at 02:34
  • 14
    The answer is missing some parts of the path. For example, mine is: /Developer/Eclipse/Eclipse.app/Contents/MacOS/eclipse – Lara Dougan Sep 07 '09 at 18:27
  • Worked as written for me. No need to delve deeper into the application package. (Although it did give me the error that my workspace was already open.) – Z O. Jan 24 '12 at 21:39
  • But now I can't close the terminal window until I close eclipse – Blundell Jul 05 '12 at 07:37
  • @LaraDougan why is your Eclipse located under /Developer? – Thorbjørn Ravn Andersen Nov 27 '13 at 00:21
  • Here is another way to do that and it will not background the process as well..Here is the link: https://blogs.oracle.com/dns/entry/opening_multiple_eclipse_instances_on – Pirate Feb 13 '14 at 07:26
  • 1
    For the mac, you can make an alias to do this from any directory in the terminal as well: alias eclipse='open -n /Applications/eclipse/Eclipse.app'. The -n is for "Open a new instance of the application(s) even if one is already running." – Jeffrey Martinez Feb 14 '14 at 18:35
  • For some reason I can't fathom, after months of working fine, today this solution is no longer working for me, so I switched to Milhous' solution. – hBrent Jul 28 '14 at 17:15
  • For eclipse mars : `./Eclipse.app/Contents/MacOS/eclipse` – To Kra Aug 17 '15 at 11:13
  • While the solution here works for me, unfortunately it loses all of my BetterTouchTool shortcuts for Eclipse for the second copy. Perhaps a different path/executable would work better with BetterTouchTool. – Marcus Sep 03 '15 at 17:49
  • For me path was : /Applications/Eclipse.app/Contents/MacOS – saurabh agarwal Jul 12 '17 at 19:40
  • this still works on 10.14 but I think the 'open -n Eclipse.app' is a cleaner approach – Kevin Hooke May 17 '19 at 21:34
24

To make this you need to navigate to the Eclipse.app directory and use the following command:

open -n Eclipse.app
A. K. Sahu
  • 251
  • 2
  • 2
20

Actually a much better (GUI) solution is to copy the Eclipse.app to e.g. Eclipse2.app and you'll have two Eclipse icons in Dock as well as Eclipse2 in Spotlight. Repeat as necessary.

Jevgeni Kabanov
  • 2,592
  • 23
  • 23
  • This is what I actually ended up doing. In fact, since I rarely upgrade Eclipse during ongoing projects, but start new projects with the latest Eclipse, I now have three different versions of Eclipse, all in the dock. – Thilo Feb 20 '12 at 00:24
  • 1
    I do much the same, but I have an app copy per workspace, and then add this to Info.plist: -datapathto/workspaces/myworkspace. That plus a plugin to add icon badges based on workspace name, and I'm a happy camper. – Danny Thomas Nov 30 '12 at 17:01
18

If the question is how to easily use Eclipse with multiple different workspaces, then you have to use a kludge because shortcuts in OS X do not provide a mechanism for passing command line arguments, for example the "--data" argument that Eclipse takes to specify the workspace. While there may be different reasons to create a duplicate copy of your Eclipse install, doing it for this purpose is, IMNSHO, lame (now you have to maintain multiple eclipse configurations, plugins, etc?).

In any case, here is a workaround. Create the following script in the (single) Eclipse directory (the directory that contains Eclipse.app), and give it a ".command" suffix (e.g. eclipse-workspace2.command) so that you can create an alias from it:

#!/bin/sh
# open, as suggested by Milhous
open -n $(dirname $0)/Eclipse.app --args -data /path/to/your/other/workspace

Now create an alias to that file on your desktop or wherever you want it. You will probably have to repeat this process for each different workspace, but at least it will use the same Eclipse installation.

aaron
  • 1,028
  • 10
  • 13
  • 1
    +1 for the workaround solution, and I want to put in an argument for having multiple workspaces with different settings. As a contractor, you often have to adopt the client's styles and preferences. By creating a new workspace you can easily partition your work among several clients. Also, you may have to support an old account while working on a new account. With this scheme you can keep both open at the same time. I currently keep switching between workspaces, but I like this convenience of opening both (all) at once as needed. – mobibob Apr 02 '11 at 20:34
6

2018 Update since many answers are no longer valid

OS X Heigh Sierra (10.13) with Eclipse Oxygen

Go to wherever your Eclipse is installed. Right-click -> Show Package Contents -> Contents -> MacOS -> Double-click the executable called eclipse

A terminal window will open and a new instance of eclipse will start.

Note that if you close the terminal window, the new Eclipse instance will be closed also.

enter image description here

To make your life easier, you can drag the executable to your dock for easy access

enter image description here

Community
  • 1
  • 1
Fangming
  • 20,957
  • 4
  • 91
  • 84
4

One another way is just to duplicate only the "Eclipse.app" file instead of making multiple copies of entire eclipse directory. Right-Click on the "Eclipse.app" file and click the duplicate option to create a duplicate.

Sujan Reddy A
  • 112
  • 1
  • 6
4

Instead of copying Eclipse.app around, create an automator that runs the shell script above.

Run automator, create Application.

choose Utilities->Run shell script, and add in the above script (need full path to eclipse)

Then you can drag this to your Dock as a normal app.

Repeat for other workspaces.

You can even simply change the icon - https://discussions.apple.com/message/699288?messageID=699288򪮘

Pete
  • 41
  • 1
2

Based on a previous answer that helped me, but different directory:

cd /Applications/Eclipse.app/Contents/MacOS
./eclipse &

Thanks

Johan Witters
  • 1,328
  • 7
  • 20
2

If you're like me, you probably have terminal running most of the time as well. You could just create an alias in /Users//.bash_profile like this alias eclipse='open -n path_to_eclipse.app'

then all you have to do is just open the terminal and type eclipse.

James
  • 21
  • 1
1

I found this solution a while back, can't remember where but it still seems to work well for me.

Create a copy of Eclipse.app for each workspace you want to work in (for this example ProjectB.app), then open ProjectB.app/Contents/MacOS/eclipse.ini and add these two lines at the beginning of the file:

-data
/Users/eric/Workspaces/projectb

... substituting where your workspace is located. When you launch ProjectB.app it will automatically start with that workspace instead of prompting for a location, and you should be able to run it at the same time as other Eclipse instances with no problem.

devewm
  • 71
  • 1
  • 5
1

If you want to open multiple workspaces and you are not a terminal guy, just locate the Unix executable file in your eclipse folder and click it.

The path to the said file is

Eclipse(folder) -> eclipse(right click) -> Show package Contents -> Contents -> MacOs -> eclipse(unix executable file)

Clicking on this executable will open a separate instance of eclipse.

Abdullah Khan
  • 9,469
  • 3
  • 52
  • 64
1

In Terminal simply paste below line and hit enter ..

/Applications/Eclipse.app/Contents/MacOS/eclipse ; exit;

susant
  • 332
  • 3
  • 10
1

You can create an AppleScript file to open Eclipse with a given workspace. You can even save the AppleScript file as an Application, which is equivalent to creating an alias with arguments in Windows OS.

Open Script Editor and type the following:

do shell script "open '/path/to/your/Eclipse/installation' -n --args -data /path/to/your/workspace"

For instance:

do shell script "open '/Applications/Eclipse.app' -n --args -data /MyWorkspaces/Personal" 

Press the Run button to check it's working.

This script can be saved as such, but I prefer to save it as an Application. That way I can customize the icon by copying the *.icns icon from the original Eclipse.app bundle to the script application bundle.

To open an App folder, use the "see contents" contextual menu option. It should look like this:

contents of script app

Where "main.scpt" is the AppleScript file and "applet.icns" is the icon from the original Eclipse bundle.

Agustí Sánchez
  • 8,543
  • 2
  • 25
  • 23
0

You can run multiple instances of Eclipse by creating a pseudonym for Eclipse application in it's folder and using it for running new Eclipse instance

0

Launch terminal and run open -n /Applications/Eclipse.app for a new instance.

Jayant Varshney
  • 1,598
  • 1
  • 22
  • 37
0

Lets try downloading this in your eclipse on Mac you will be able to open multiple eclipse at a time Link

Name : macOS Eclipse Launcher

Steps :

  1. Go to eclipse Market place.
  2. Search for "macOS Eclipse Launcher" and install.
  3. It will restart .
  4. Now under file menu check for open option > there you will find other projects to open also at same time .
Tarit Ray
  • 798
  • 9
  • 23
0

A more convenient way:

  1. Create an executable script as mentioned above:

    #!/bin/sh

    cd /Applications/Adobe\ Flash\ Builder\ 4.6

    open -n Adobe\ Flash\ Builder\ 4.6.app

  2. In you current instance of Flashbuilder or Eclipse, add a new external tool configuration. This is the button next to the debug/run/profile buttons on your toolbar. In that dialog, click on "Program" and add a new one. Give it the name you want and in the "Location" field, put the path to the script from step 1:

    /Users/username/bin/flashbuilder

  3. You can stop at step 2, but I prefer adding a custom icon to the toolbar. I use a the Quick Launch plugin to do that:

    http://sourceforge.net/projects/quicklaunch/files/

  4. After adding the plugin, go to "Run"->"Organize Quick Lauches" and add the external tool config from step 2. Then you can configure the icon for it.

  5. After you save that, you'll see the icon in your toolbar. Now you can just click it every time you want a new Flashbuilder/Eclipse instance.

kash
  • 189
  • 1
  • 7
-8
Window -> New Window

This opens a new window and you can then open another project in it. You can use this as a workaround hopefully.

It actually allows you to work in same workspace.

Echilon
  • 9,631
  • 27
  • 126
  • 209
sijju
  • 1