Go to %TOMCAT_HOME%\bin
and create the file startup-jrebel.cmd
with the following contents:
@echo off set JREBEL_BOOTSTRAP="%~dp0\jrebel-bootstrap.jar" java -Drebel.bootstrap=%JREBEL_BOOTSTRAP% -jar $AGENT_PATH_WIN set JAVA_OPTS=-noverify -Xbootclasspath/p:%JREBEL_BOOTSTRAP%;$AGENT_PATH_WIN %JAVA_OPTS% call "%~dp0\startup.bat" %*
You can also create a catalina-jrebel.cmd
with the following content:
@echo off set JREBEL_BOOTSTRAP="%~dp0\jrebel-bootstrap.jar" java -Drebel.bootstrap=%JREBEL_BOOTSTRAP% -jar $AGENT_PATH_WIN set JAVA_OPTS=-noverify -Xbootclasspath/p:%JREBEL_BOOTSTRAP%;$AGENT_PATH_WIN %JAVA_OPTS% call "%~dp0\catalina.bat" %*
Use those command files instead of startup.bat
and catalina.bat
if you want to run Tomcat with JRebel.
If you're running Tomcat as a Windows service then first generate the jrebel-bootstrap.jar
by running java -jar $AGENT_PATH_WIN
using the JVM you will run the application with.
Then open the tomcatXw.exe
wrapper (or double click the Tomcat icon in the system tray) and insert the following line into the Java » Java Options textbox:
-noverify -Xbootclasspath/p:$BOOTSTRAP_PATH_WIN;$AGENT_PATH_WIN
as shown on the following screenshot: