Wednesday, April 30, 2008

Zero Turnaround time with javarebel

JavaRebel is a java agent which enables reloading changes made to java classes on the fly. It enables developers to work without redeploying or re-starting a container. It works in both the Java EE and SE environment.
A normal deployment cycle looks like
1) Make changes to your classes
2) Create the new archive
3) Touch the archive in the deployment environment
4) Restart application server/Redeploy application
5) Check the modifications
With JavaRebel, you can reduce the above steps to
1) Make changes to your classes
2) Background compilation
3) Check for modifications

For standard environments using java 5 and above, we need to add the following to the jvm path
-noverify -javaagent:/path/to/javarebel.jar

For an app-server environment, for JBoss 4.x, we need to add the following in the $JBOSS_HOME/bin/run.sh(%JBOSS_HOME%/bin/run.bat on windows), add the following
JAVA_OPTS="-noverify -javaagent:javarebel.jar $JAVA_OPTS"
or on Windows
set JAVA_OPTS= -noverify -javaagent:javarebel.jar %JAVA_OPTS%

Happy Non-Deployment :-)



The emperor and me beaching

The Devil next door

Kaiser The Emperor