JRebel Installation and Configuration

From MPDLMediaWiki
Jump to navigation Jump to search

What is JRebel?[edit]

Whenever you make a change to your Java code or your JSP/JSF 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 OSS-committers at Max Planck Digital Library.

Installation[edit]

  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 (UTC)

Configuration of JBoss[edit]

  1. Add the following line to your JBoss startup VM 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 JBoss in Eclipse[edit]

  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 VM arguments.

Configuration of development/build environment[edit]

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 SVN folders and rebuild the packages that you want to use with JRebel.

Additional Eclipse debug configuration[edit]

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[edit]

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

  1. Start JBoss server
  2. Deploy an application, e.g. PubMan
  3. Change sth in a Java class or a JSP/JSF file and save the file.
  4. View the result directly in the webbrowser

Please share your experiences here: Talk:JRebel_Installation_and_Configuration