Latest news

JavaRebel gets Guice, Struts2, Tapestry 4 and Freemarker support

We are proud to announce specialized support for four new frameworks....

JavaRebel 1.2.1 and Spring Plugin 1.0-M2 Released

We are very proud to present not one, but two simultaneous releases....

JavaRebel used to develop LinkedIn

LinkedIn, Corp. has purchased JavaRebel licenses for all its Java engineers to use in the well-known social networking website dev...

Posts Tagged ‘wtp’

JavaRebel and Eclipse WTP configuration

Monday, August 11th, 2008

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.

Click for original size - Run Configurations 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

Click for original size - Run Configurations JavaRebel Configured

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

Installation Confirmation

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.

WTP Specific Configurations

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.

Click for original size - Automatic Publishing Settings

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.

Click for original size - 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.