Forum Controls
Spotlight Features

The Rich Engineering Heritage Behind Dependency Injection

Andrew McVeigh takes us on a tour of the rich heritage behind dependency injection, what it represents, and tells us why its here to stay.

NetBeans 6: Matisse Updates

NetBeans 6 delivers great updates to the Matisse GUI builder. Spend a few minutes with Roman Strobl and get an expert briefing on what's new and what has changed.

Introduction to Groovy Part 3

In this, the third and final installation of Andres' Introduction to Groovy series, you learn about how Groovy handles variable numbers of arguments, named parameters, currying, and more about Groovy operators. Including, some new operators.

Easier Custom Components with Swing Fuse

Swing Fuse (actually just Fuse), is a framework designed to make it easier to create your own custom desktop components. In this article, Daniel Spiewak shows you how to get started and provides sample source code you can download.

Benchmark Analysis: Guice vs Spring

Willam Louth shows how he uses JXInsight Probes to investigate probable performance issues with code bases that he is not familiar with. He also highlights possible pitfalls in creating a benchmark, as well as in the analysis of results.
Replies: 15 - Pages: 2   [ 1 2 | Next ]
Threads: [ Previous | Next ]
  Click to reply to this thread Reply

Eclipse: Managing Multiple Eclipse Installations

At 12:43 PM on May 12, 2005, R.J. Lorimer wrote:

On the verge of another Eclipse milestone release (3.1 M7 for this Friday), I thought it would be good to share my experiences with managing multiple Eclipse installs with everyone so you could try out the new Eclipse installations, without ruining your day by accidentally breaking your IDE, and being unable to get any work done.

First, let me say that you should *never* update Eclipse by just unzipping over another installation. At a bare minimum if you are just overwriting another Eclipse installation like this, you should first go through and delete the features, plugins and configuration folders. If you are interested, however, I'm going to explain a better way in today's tip.

The first step to managing an Eclipse installation is to understand the different components that Eclipse can broken into.

  • Installations - An Eclipse installation is the shipped product that you download from Eclipse.org, and unzip on to your file system.
  • Extensions - Extensions are third party plug-ins that you install (such as the Sysdeo Tomcat Plug-in ).
  • Workspaces - Workspaces are where a.) user preferences are stored, and b.) Your projects (and their code) are stored.
  • Each of these items can be managed independently of each other - and it is usually beneficial to do so. Here is how:

    Installations:

    Eclipse installations can be put anywhere on your filesystem - I typically put them in c:\eclipse-installations\ . So, for instance, I will download Eclipse M7 tomorrow, extract it to c:\eclipse-installations\ and then rename the new eclipse folder the produced by the extraction to eclipse_31_M7 - so my installation folder may look like this:

    c:\eclipse_installations\eclipse_31_M7\
    c:\eclipse_installations\eclipse_M6\
    c:\eclipse_installations\eclipse_bleeding_edge\
    c:\eclipse_installations\eclipse_30\
    

    That is it for Eclipse installations. Each of those Eclipse installations can be run independently (and can be started concurrently I might add). Don't do that yet, we still have some work to do!

    Extensions:

    The default way to install plug-ins is to simply drop the plugin into the [ECLIPSE_HOME]/plugins folder. The only problem with this is that those plug-ins have to be dropped into each installation's 'plugins' folder. So, for instance, for the sysdeo plugin given the above example, I would have this:

    c:\eclipse_installations\eclipse_31_M7\com.sysdeo.eclipse.tomcat_3.0.0\
    c:\eclipse_installations\eclipse_M6\com.sysdeo.eclipse.tomcat_3.0.0\
    c:\eclipse_installations\eclipse_bleeding_edge\com.sysdeo.eclipse.tomcat_3.0.0\
    c:\eclipse_installations\eclipse_30\com.sysdeo.eclipse.tomcat_3.0.0\
    

    This actually isn't a serious problem, because the preferences for the plugin are set in your workspaces folder, which is different from the extension installation. It can be a hassle to have to copy these files around. Eclipse does have a little-known-feature that allows for an installation to be extended by an external directory structure. The complete process is described here by Matthew Conway ( Update: Matt was kind enough to email me and tell me that I goofed and misspelled his last name ;)): http://simplygenius.com/geekblog/2005/04/08/1112982083849.html

    To paraphrase, you can construct a pseudo Eclipse installation in a separate location; we'll call it c:\eclipse_extensions , and then install all of your third-party plug-ins there. To create it, follow these steps:

    1. Create an eclipse folder ( c:\eclipse_extensions\eclipse )
    2. Create an eclipse features folder ( c:\eclipse_extensions\eclipse\features )
    3. Create an eclipse plugin folder ( c:\eclipse_extensions\eclipse\plugins
    4. Create an extension descriptor file, and fill it with these contents (ala the SimplyGenius Website) ( c:\eclipse_extensions\eclipse\.eclipseextension ):
      name=My Eclipse Configuration
      id=my.eclipse.configuration
      version=1.0.0
      
      Note that the values of these properties aren't strictly that important, but leaving them to the values seen above works just fine.

    Then, simply install any plug-ins or features in to that extensions path, as opposed to into Eclipse directly. So, again, for Sysdeo, you might have:

    c:\eclipse_extensions\eclipse\plugins\com.sysdeo.eclipse.tomcat_3.0.0\
    

    The only remaining step will be to point your unique Eclipse installations to that extension location on first boot. To get an Eclipse installation to load an external extension location - Go to Help->Software Updates->Manage Configuration... :

    ... and then right-click and say 'Add Extension Location', giving Eclipse the path: c:\eclipse_extensions\eclipse .

    ( Note: Just pretend that 'eclipse_experimental' in the above picture is actually 'eclipse_installations').

    It will ask you if you wish to reboot - for now just say no, and close Eclipse manually. That's it, now your Eclipse installation will load all plugins and features in that extension folder as if they were in its own plugins folder.

    Workspaces

    Workspaces are the last component I want to discuss - and creating new workspaces is as simple as changing your shortcut to Eclipse (or your startup-script). Workspaces are where you keep the code, and are also where you save your preferences (Java Editor settings, code formatting settings, colors, fonts, key mappings, etc). I'll continue the Windows theme here. First, create a workspace folder, such as c:\eclipse-workspaces\ . Next, create a shortcut to one of your Eclipse installations that references a subfolder in this new folder as part of the -data argument. So, rather than having c:\eclipse_installations\eclipse_31_M7\eclipse.exe as your startup command in your shortcut (or startup script or whatever), you would have C:\eclipse_installations\eclipse_31_M7\eclipse.exe -data c:\eclipse-workspaces\ workspace1 . Actually, while we're at it, we can make the memory allocation more reasonable. Here are three different startups with different installations and different workspaces that all use the same extensions folder (note, I have put these on multiple lines to make them easier to read):

    c:\eclipse_installations\eclipse_31_M7\eclipse.exe 
      -data c:\eclipse-workspaces\workspace1 
      -vmargs -Xms256M -Xmx256M
      
    c:\eclipse_installations\eclipse_30\eclipse.exe 
      -data c:\eclipse-workspaces\workspace2 
      -vmargs -Xms128M -Xmx256M
      
    c:\eclipse_installations\eclipse_bleeding_edge\eclipse.exe 
      -data c:\eclipse-workspaces\workspace3 
      -vmargs -Xms256M -Xmx256M
      
    c:\eclipse_installations\eclipse_bleeding_edge\eclipse.exe 
      -data c:\eclipse-workspaces\workspace1 
      -vmargs -Xms256M -Xmx256M
    

    In the above example, workspace1 is running under Eclipse 3.1 M7, workspace2 is running under Eclipse 3.0, and workspace3 is running under some bleeding edge integration build. Finally, notice that I have also made another shortcut to workspace1 running under a completely different installation.

    One final thing to note - a lot of users feel frustrated because their workspace preferences can't be shared from one workspace to another transparently (for instance, I use the same code formatter for multiple workspaces). There are some technical reasons why this isn't typically done, but there are workarounds. You can always copy the workspace folder and rename it to create another workspace. Alternatively, you can copy the .metadeta folder under one workspace, and paste it into another. These are 'black magic' ways to do this however, so do so at your own risk. The most appropriate way is to go to a particular workspace, and perform a preferences export. You can do this in 3.1 milestone builds by going to File->Export and selecting preferences - then select what preferences you want to export, and where you want to export them (e.g. c:\eclipse-workspaces\preference_backups\workspace_preferences_05-11-05.epf).

    Then you just need to import to your other workspaces the same way. Voila!

    Until next time,

    R.J. Lorimer
    rj -at- javalobby.org
    http://www.coffee-bytes.com

    1 . At 11:20 PM on May 12, 2005, Colin Sampaleanu wrote:
      Click to reply to this thread Reply

    Re: Eclipse: Managing Multiple Eclipse Installations

    The first part of this post is suspiciously similar to my old blog entry:
    http://blog.exis.com/colin/archives/2004/12/23/managing-plugins-in-eclipse/

    A little bit of credit might not have hurt. In any case, it's useful advice, no matter what the source...
    2 . At 12:14 AM on May 13, 2005, R.J. Lorimer wrote:
      Click to reply to this thread Reply

    Re: Eclipse: Managing Multiple Eclipse Installations

    Colin,

    I assure you I'm no content thief - any similarity to your blog entry was purely coincidental. I *always* give credit/recognition where it is due. After all, I referenced another blog in this tip where I did receive some information that I subsequently used in this post; there is no reason I would omit referencing yours if I had in fact taken the content from there. It is frightening how similar it actually is, though. Although I see your posts on the Spring mailing-lists all the time, however, I don't think I've ever been to your blog.

    In any case, let's just chalk it up to great minds think alike ;) - the advice is indeed quite useful.

    Regards,
    Best, R.J. Lorimer
    3 . At 8:31 AM on May 13, 2005, David Heffelfinger DeveloperZone Top 100 wrote:
      Click to reply to this thread Reply

    Re: Eclipse: Managing Multiple Eclipse Installations

    I like to try out different plugins, sometimes they turn out to be lemons. I have found that it is hard to figure out which of the created directories under the plugins or features directory belong to what plugin. I have gotten into the habit of creating a new extension location for each plugin I download. That way if I want to uninstall it later all I have to do is delete the extension location for the plugin.

    Am I missing something, or is there no easy way to uninstall a plugin from Eclipse? The closest thing I have found is to disable it, but I have found no easy way to uninstall it, that is why I install each plugin into its own extension location.

    Ray
    Author, Java EE 5 Using GlassFish Application Server
    Author, JasperReports For Java Developers
    4 . At 8:52 AM on May 13, 2005, Mark N DeveloperZone Top 100 wrote:
      Click to reply to this thread Reply

    Re: Eclipse: Managing Multiple Eclipse Installations

    If you know what the directories were, you can just delete them. I think the next (or can you already do it?) release of Eclipse will allow packaging of plugins in jars. That will them much easier to remove.

    http://download.eclipse.org/eclipse/downloads/drops/S-3.1M6-200504011645/eclipse-news-part1-M6.html
    5 . At 9:21 AM on May 13, 2005, David Heffelfinger DeveloperZone Top 100 wrote:
      Click to reply to this thread Reply

    Re: Eclipse: Managing Multiple Eclipse Installations

    Nice to see that it will be possible to install plugins as single jars. I hope that becomes the standard way of distributing plugins.

    I know that if I delete the correct directories the plugin will be uninstalled, but it is not alway obvious which directories belong to what plugin. It is a lot easier to delete an extension location, that way I know for sure I am not deleting anything I shouldn't, or leaving anything that should be deleted.
    Author, Java EE 5 Using GlassFish Application Server
    Author, JasperReports For Java Developers
    6 . At 9:48 AM on May 13, 2005, Mike Miller wrote:
      Click to reply to this thread Reply

    Re: Eclipse: Managing Multiple Eclipse Installations

    Another option that I found, for managing my plugins, from reading some Eclipse newsletters was the setting up a link to a separate folder that contains all of my extra features/plugins. Check the helps for 'Product Extensions'. As best I remember you do the following:

    1) Create a directory named links under the eclipse installation directory, so for windows c:\eclipse\links, for example.

    2) within that directory, create a file (I call it myplugins.link), with some name and the extension of .link

    3) the contents of the file is path= /myplugins

    4) Under the /myplugins you create a partial directory structure of \eclipse, \eclipse\features and \eclipses\plugins.

    5) Now install new features/plugins to this directory rather than the eclipse installation directory.

    Now when you upgrade to a newer version of Eclipse, all you should need to do is the copy the old links folder from the old installation to the new installation.
    7 . At 9:52 AM on May 13, 2005, Mike Miller wrote:
      Click to reply to this thread Reply

    Re: Eclipse: Managing Multiple Eclipse Installations

    After posting, I noticed contents of the link file did not display correctly because I used < and > within the text. The file should contain path=c:/somedir/myplugins
    8 . At 3:40 PM on May 16, 2005, Andrei Loskutov wrote:
      Click to reply to this thread Reply

    Re: Eclipse: Managing Multiple Eclipse Installations

    > Another option that I found, for managing my plugins,
    > from reading some Eclipse newsletters

    Was it probably this one:
    http://www.vasanthdharmaraj.com/PermaLink,guid,ed866f73-5ca4-4b7b-bb72-acefd5a8d075.aspx
    9 . At 3:55 PM on May 16, 2005, JD wrote:
      Click to reply to this thread Reply

    Re: Eclipse: Managing Multiple Eclipse Installations

    some may find my windows batch files for managing plugin repositories helpful...

    see: http://stacktrace.org/index_html/20050309-EclipseWin32Scripts
    10 . At 2:57 PM on Jun 23, 2006, Greg Pentz wrote:
      Click to reply to this thread Reply

    Re: Eclipse: Managing Multiple Eclipse Installations

    This is very useful.

    What I'd like to know is whether updating from an update site (either one you mirror or one out on the net) can point to the extensions directory you have added?

    Thanks
    11 . At 6:28 AM on Oct 8, 2006, thabet wrote:
      Click to reply to this thread Reply

    Re: Eclipse: Managing Multiple Eclipse Installations

    First of all thanks a lot for your great article. But I would like you to clear out few thing mentioned in the article.

    In the Extensions part you have mentioned that; “The default way to install plug-ins is to simply drop the plugin into the [ECLIPSE_HOME]/plugins folder.”

    However few lines later you write that it will be placed under Eclipse installation folder?

    c:\eclipse_installations\eclipse_31_M7\com.sysdeo.eclipse.tomcat_3.0.0\
    c:\eclipse_installations\eclipse_M6\com.sysdeo.eclipse.tomcat_3.0.0\
    c:\eclipse_installations\eclipse_bleeding_edge\com.sysdeo.eclipse.tomcat_3.0.0\

    Which one is correct?

    Hopefully it is just you have forgotten to write “\plugins\”, and still you made a grate job with Matthew.

    I may take this opportunity to ask about plugins installation in general. I am having plugins installation nightmare! Unzipping the plug in then place its content in \plugins\, does not work at all! Can you help me, and may be many others, in that? How can check what went wrong?

    Best rgards
    Thabet
    12 . At 7:37 AM on Mar 19, 2007, Israr Ahmed wrote:
      Click to reply to this thread Reply

    Re: Eclipse: Managing Multiple Eclipse Installations

    Indeed an interesting tutorial for managing multiple Eclipse installations.
    There certainly have been performance issues with Java. We've been working really hard on them. The primary way we've attacked the problem is with advanced virtual machines. The performance has been getting very nice. --James Gosling, 1999.
    13 . At 4:15 PM on Sep 27, 2007, Lance E Sloan wrote:
      Click to reply to this thread Reply

    Re: Eclipse: Managing Multiple Eclipse Installations

    Helpful article, Mr. Lorimer. I was just wondering if there is any way to associate a unique extension location for each of my workspaces? I would like to do that because, as one ofyour other readers commented, I tend to try out lots of extensions, some of which are buggy or conflict with each other.

    So, I would like to set up a "workspace-jee" workspace directory that uses extensions in "extensions-jee". And a "workspace-python" that uses extensions in "extensions-python". I've actually tried this already, but it didn't quite work. In each workspace, I disabled the opposite extension location. However, when I switched back to the previous workspace, it was using the last extension location I has chosen. Apparently the extension location information is kept somewhere other than the workspace itself, maybe in my home directory or in the Eclipse installation directory.

    Let me know if you have any ideas for making something like this work.
    14 . At 10:24 PM on Nov 12, 2007, Mandala wrote:
      Click to reply to this thread Reply

    Re: Eclipse: Managing Multiple Eclipse Installations

    Great article.
    I used to install many plugin in a Eclipse,which would
    bring some conflict or bugs.
    Now I can insatll multiple Ecilpse for the plugin.
    java - java string

    thread.rss_message