How to Run Eclipse in Clean Mode? What Happens If We Do So

How to run eclipse in clean mode? what happens if we do so?

What it does:

if set to "true", any cached data used
by the OSGi framework and eclipse
runtime will be wiped clean. This will
clean the caches used to store bundle
dependency resolution and eclipse
extension registry data. Using this
option will force eclipse to
reinitialize these caches.

How to use it:

  • Edit the eclipse.ini file located in your Eclipse install directory and insert -clean as the first line.
  • Or edit the shortcut you use to start Eclipse and add -clean as the first argument.
  • Or create a batch or shell script that calls the Eclipse executable with the -clean argument. The advantage to this step is you can keep the script around and use it each time you want to clean out the workspace. You can name it something like eclipse-clean.bat (or eclipse-clean.sh).

(From: http://www.eclipsezone.com/eclipse/forums/t61566.html)

Other eclipse command line options: http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fmisc%2Fruntime-options.html

What does the -clean parameter mean in the Eclipse IDE?

No you can simply launch eclipse.

The article "keeping eclipse running clean" details the various usages for "the -clean" option.

The easiest way to fix up a dusty workspace is using the -clean command line argument to the eclipse.exe executable. Let's take a look at what the Eclipse help docs tell us this command does:

if set to "true", any cached data used by the OSGi framework and eclipse runtime will be wiped clean. This will clean the caches used to store bundle dependency resolution and eclipse extension registry data. Using this option will force eclipse to reinitialize these caches.

The -clean argument is a one-time use flag, meaning after you have run Eclipse using it, you can remove it until you need it again.

If you prefer to leave it set the only side effect of using it ever time are increased startup times (2-3x longer) which some folks do not mind.

Now, back to the description above, this may not sound like much, I have to say that you would be amazed at what using -clean can fix up sometimes; some really random things. There are three easy ways you can go about using this argument:

  • Edit the eclipse.ini file located in your Eclipse installation directory and add it as the first argument on the first line.
  • Edit the shortcut you use to start Eclipse and add it as the first argument.
  • Create a batch or shell script that calls the Eclipse executable with the -clean argument. The advantage to this step is you can keep the script around and use it each time you want to clean out the workspace. You can name it something like eclipse-clean.bat (or eclipse-clean.sh).

how to run Eclipse -clean on a Mac?

If you CD to the eclipse installation directory using terminal, then you will see there is a directory called eclipse.app. CD to Eclipse.app\Contents\MacOS under that directory there should be an executable called eclipse.

I believe you can launch eclipse from the commandline by executing the eclipse executable with the -clean argument, as below:

./eclipse -clean

Function of Project > Clean in Eclipse

Its function depends on the builders that you have in your project (they can choose to interpret clean command however they like) and whether you have auto-build turned on. If auto-build is on, invoking clean is equivalent of a clean build. First artifacts are removed, then a full build is invoked. If auto-build is off, clean will remove the artifacts and stop. You can then invoke build manually later.

Clean out Eclipse workspace metadata

There is no easy way to remove the "outdated" stuff from an existing workspace. Using the "clean" parameter will not really help, as many of the files you refer to are "free form data", only known to the plugins that are no longer available.

Your best bet is to optimize the re-import, where I would like to point out the following:

  • When creating a new workspace, you can already choose to have some settings being copied from the current to the new workspace.
  • You can export the preferences of the current workspace (using the Export menu) and re-import them in the new workspace.
  • There are lots of recommendations on the Internet to just copy the ${old_workspace}/.metadata/.plugins/org.eclipse.core.runtime/.settings folder from the old to the new workspace. This is surely the fastest way, but it may lead to weird behaviour, because some of your plugins may depend on these settings and on some of the mentioned "free form data" stored elsewhere. (There are even people symlinking these folders over multiple workspaces, but this really requires to use the same plugins on all workspaces.)
  • You may want to consider using more project specific settings than workspace preferences in the future. So for instance all the Java compiler settings can either be set on the workspace level or on the project level. If set on the project level, you can put them under version control and are independent of the workspace.

Eclipse Project --> Clean goes forever

close eclipse, reopen, close every project open that is not needed for your project, and try again



Related Topics



Leave a reply



Submit