# Removing the MTJ plug-in

Obviously we hope that you find MTJ so useful that you will never want to be without it. If you really feel you need to remove it, however, or if you want to do a completely "clean" install, you can follow these steps to remove MTJ from your Eclipse installation:

1. The "Normal" way
2. The "Brute Force" method
3. Removing MTJ traces from a project

### The "Normal" way

1. Uninstall MTJ. Please refer Eclipse help document or visit Eclipse Help web site, select Workbench User Guide > Tasks > Updating and installing software > Uninstalling software using the Uninstall wizard document node for information about how to install software.
2. Uninstall the preprocessor hooks:
   1. Locate the file config.ini. This file is located in the <eclipse install>/configuration directory.
   2. Edit the config.ini with your favorite text editor.
   3. Remove the property definition
      `osgi.framework.extensions=eclipseme.core.hooks`
      from the configuration file.
   4. Save the configuration file.
   5. Restart Eclipse.
   6. Delete the eclipseme.core.hooks plugin from your file system.

### The "Brute Force" method

If the "Normal" method doesn't work, or if you want to make absolutely sure that everything is gone, you can always remove MTJ the "brute force" way:

1. Close any running copies of Eclipse.
2. Open the features directory within your Eclipse installation directory.
3. Delete any directories whose name begin with "org.eclipse.mtj". (e.g. org.eclipse.mtj.feature_0.6.1)
4. Open the plugins directory within your Eclipse installation directory.
5. Delete any directories whose name begin with "org.eclipse.mtj". (e.g. org.eclipse.mtj.core_0.6.1, org.eclipse.mtj.docs_0.6.1, etc.)

6. If you have chosen to install the preprocessor support using the instructions, Eclipse will not remove the hooks necessary for the preprocessor. To uninstall, the preprocessor hooks:

   1. Locate the file config.ini. This file is located in the <eclipse install>/configuration directory.
   2. Edit the config.ini with your favorite text editor.
   3. Remove the property definition
      `osgi.framework.extensions=org.eclipse.mtj.core.hooks`
      from the configuration file.
   4. Save the configuration file.
7. Invoke eclipse using the -clean command line option. This will force Eclipse to re-scan its lists of installed features and plugins in order to ensure that the appropriate updates to Eclipse's metadata are performed.

### Removing MTJ traces from a project

If you want to remove all traces of MTJ from a project, you need to do the following from outside Eclipse:

1. MTJ creates a file named .mtj in the root of each MIDlet project. Remove this file.
2. MTJ adds a build command and a "nature" to the .project file associated with each Eclipse project. A typical Eclipse .project file looks like this:

       <xml version="1.0" encoding="UTF-8"?>
       <projectDescription>
       	<name>PaperClick Java Go Window</name>
       	<comment></comment>
       	<projects>
       	</projects>
       	<buildSpec>
       		<buildCommand>
       			<name>org.eclipse.jdt.core.javabuilder</name>
       			<arguments>
       			</arguments>
       		</buildCommand>
       		<buildCommand>
       			<name>org.eclipse.mtj.core.preverifier</name>
       			<arguments>
       			</arguments>
       		</buildCommand>
       	</buildSpec>
       	<natures>
       		<nature>org.eclipse.jdt.core.javanature</nature>
       		<nature>org.eclipse.mtj.core.nature</nature>
       	</natures>
       </projectDescription>

   The underlined items are the ones you should remove.