JRebel Installation and Configuration

From MPDLMediaWiki
Jump to: navigation, search

What is JRebel?

Whenever you make a change to your Java code or your JSPJavaServer Pages/JSFJavaServer Faces page, you have to rebuild and redeploy the complete application in order to see or debug the changes. This can get very time-consuming and annoying. Unfortunately, Eclipse and other development environments do not support incremental hot deployment in combination with different application servers.

JRebel is a great tool that bridges this gap. It watches for changes in the class and resource files and maps them directly to the application server. This table shows what you can now do without a complete redeployment.

JRebel is not free, but supports Open source Projects. Luckily, we could convince them of our projects and got free one-year licenses for the OSSOpen Source Software-committers at Max Planck Digital Library.

Installation

  1. Download the zip file: http://www.zeroturnaround.com/jrebel/download/
  2. Unpack the zip to an arbitrary directory
  3. Copy the license file (*.lic) to the JRebel directory

In version 2.2.1 you can also choose an installation jar which works quite nicely. --MFranke 10:22, 23 February 2010 (UTCCoordinated Universal Time)

Configuration of JBossOpen source Java EE-based application server

  1. Add the following line to your JBossOpen source Java EE-based application server startup VMVirtual Machine arguments. Replace the path with your individual complete path to the jrebel.jar file.

-noverify -javaagent:c:\programme\javarebel-2.0.3\jrebel.jar

Configuration of JBossOpen source Java EE-based application server in Eclipse

  1. Go to your server tab.
  2. Double click on the server, a settings window will open.
  3. Click on "Open launch configuration"
  4. Open the "Arguments" tab
  5. Add the above line (with your JRebel path) to the VMVirtual Machine arguments.

Configuration of development/build environment

JRebel has to know which class and resource files it should watch for changes. The default is all .class files on the classpath. For additional files and directories a config file named "rebel.xml" is required that describes these paths. There is a Maven Plugin available which automatically creates this rebel.xml for our projects. It is already added to our parent project POMs (in the env-development profile), so all you have to do is to update your SVNApache Subversion folders and rebuild the packages that you want to use with JRebel.

Additional Eclipse debug configuration

JRebel recommends to additionally configure the Eclipse debugger in order to ignore synthetic methods. They describe the configuration in their installation instructions under Step 3.

Working with JRebel

After following these instructions, JRebel should be ready to work with our projects. Just try it out:

  1. Start JBossOpen source Java EE-based application server server
  2. Deploy an application, e.g. PubManPublication Management
  3. Change sth in a Java class or a JSPJavaServer Pages/JSFJavaServer Faces file and save the file.
  4. View the result directly in the webbrowser

Please share your experiences here: Talk:JRebel_Installation_and_Configuration