AnvilJ consists of two components:
  • A plugin for the Eclipse development environment
  • An AnvilJ runtime (a Java JAR file)

Installing the plugin

To install AnvilJ, do the following:
  1. If you do not already have it installed, grab the latest version of Eclipse. For those unfamiliar with Eclipse, it comes in a wide range of flavours for different developers.These are all the same IDE, but contain a different starting set of packages for different end users. Unless you have special requirements, select the version "Eclipse IDE for Java Developers". This is the 'standard Java' version of Eclipse. Other versions will also work fine as they can all "do Java", but contain lots of extra things you may not need. AnvilJ will work on Windows, Linux, OSX, or any other platform supported by Eclipse.
  2. AnvilJ in installed through Eclipse's normal plugin installation mechanism. From the main menu select Help | Install New Software.... Click Add..and enter the following:
  3. Press OK to add the AnvilJ Update Site, and then set the Work with drop down box to AnvilJ. You should see a category appear in the main box titled 'AnvilJ Refactoring'. Check the box next to this and select Next. Step through the rest of the install screens and let Eclipse restart after installing.

The main AnvilJ plugin is now installed. You can verify this by right-clicking on a Java project in the Package Explorer and you should see new AnvilJ menu items - AnvilJ - Perform Refactoring and AnvilJ - Clean output projects. There will also be an AnvilJ section in Eclipse's preferences window.

Installing the runtime

You also need the AnvilJ runtime. This is a JAR file which is used by projects that have passed through the AnvilJ refactoring tool. The latest stable version can be found here. This file can be placed anywhere, but when you try to run AnvilJ output projects they will need this JAR in their classpath. If you are just executing the output projects from within Eclipse then you can rely on the fact that AnvilJ will attempt to set up Eclipse to include this JAR in the classpath automatically. To use this feature you have to tell AnvilJ where to find the JAR file. Go to Window | Preferences in the Eclipse main menu and you should see an AnvilJ category on the left. Select this, and set Path to AnvilJ Runtime JAR to point to the JAR.

ajpref.jpg
AnvilJ's preferences panel

AnvilJ is now ready for use!