JRebel Installation and Configuration
What is JRebel?
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.
- Download the zip file: http://www.zeroturnaround.com/jrebel/download/
- Unpack the zip to an arbitrary directory
- 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
- Add the following line to your JBoss startup VM arguments. Replace the path with your individual complete path to the jrebel.jar file.
Configuration of JBoss in Eclipse
- Go to your server tab.
- Double click on the server, a settings window will open.
- Click on "Open launch configuration"
- Open the "Arguments" tab
- Add the above line (with your JRebel path) to the VM 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 SVN 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:
- Start JBoss server
- Deploy an application, e.g. PubMan
- Change sth in a Java class or a JSP/JSF file and save the file.
- View the result directly in the webbrowser
Please share your experiences here: Talk:JRebel_Installation_and_Configuration