There has been a lot of discussion regarding the use of JavaRebel with Eclipse Web Tools Project (WTP). JavaRebel does work with WTP but the configuration is not that straightforward. In this article we’ll try to give step by step instructions on how to make WTP and JavaRebel get along.
The article is divided into two parts. If you have JavaRebel installed under WTP you can skip to the configuration section. If you are an old time WTP user just enable autopublishing and disable auto reloading for modules.
JavaRebel Installation under WTP
Lets get started by downloading the JavaRebel zip archive from the download page. Unzip the archive somewhere on your harddisk. Copy the javarebel.jar from the uncompressed folder to a location that you can use later on. We’ll assume on Windows that this is c:\javarebel.jar and on Linux /home/john/javarebel.jar.
We’ll configure the startup of the container next. I will be using Tomcat v6.0 version. Open up the “Run Configurations” dialog from the Eclipse menu Run » Run Configurations. You should see the following dialog.

Next open the (x)= Arguments tab in the dialog and edit the VM arguments text area as seen on the next screenshot. Add the following option to the end of the area.
Windows
-noverify -javaagent:c:\javarebel.jar
Linux
-noverify -javaagent:/home/john/javarebel.jar

Now apply the settings and run the configuration. You should see the following message in the console output.

You have installed JavaRebel under WTP now. Next you need to configure some WTP options so that WTP auto publish would not interfere with JavaRebel class reloading.
Automatic publishing should be enabled in the server configuration. Double click on your server name and a configuration page opens. Under the Publish section you should have the Automatically publish when resources change option selected. I’ve outlined the automatic publishing settings in the following screenshot.

All your modules should have Auto Reload disabled. You can achieve this by opening the Modules tab of the server configuration and editing each module to disable auto reloading.

This is it. Once you have these configurations in place and you have restarted the container you are ready to use JavaRebel with WTP.
Make changes to your Java source files and they will be reloaded by JavaRebel. Make changes to your static content under you WebContent and they will be copied by WTP to your deployment folder.
If you have any questions or problems about setting up WTP and JavaRebel leave a comment or send an email to support [at] zeroturnaround.com.
Eclipse 3.4 and WTP 3.0 were used to test the functionality. The article is inspired by Utilisation de JavaRebel avec Eclipse.