Book Image

Instant JRebel

By : Jonathan Lermitage
Book Image

Instant JRebel

By: Jonathan Lermitage

Overview of this book

JRebel is a JVM plugin that lets Java developers update code instantly and see their changes reflected in their application under development without restarting the application server. JRebel is a plugin for anything that is in Java and is also IDE neutral. If you want to update your code instantly without compiling and deploying the code repeatedly, this book is for you.This book will focus on the most important development steps and will also help you save time which is otherwise spent on compilation and deployment of code. You will learn how to use JRebel with the most popular IDEs and Java servers and how to accelerate the development of your current and future Java SE and Java EE projects.This book shows you how to install JRebel, configure your favourite IDE and Java server for JRebel, and start using it on your projects.With this book, you will learn how to get a free license for JRebel and how to integrate JRebel with most Java servers and development environments. To finish, you will see how to work with desktop and web projects and how to utilize JRebel to dramatically accelerate their development.
Table of Contents (7 chapters)

JRebel for a standalone Tomcat server (Should know)


We'll see how to install and activate JRebel on a Tomcat standalone server.

How to do it...

The following are the steps that describe how to activate JRebel on a Tomcat server:

  1. Download and unzip the Tomcat server.

  2. Launch Tomcat with the startup script located in its bin directory (bin\startup.bat on MS Windows).

  3. Enable the JRebel Java Agent for the Tomcat server. To proceed, simply append -javaagent:C:\packtpub\jrebel\jrebel.jar to the JAVA_OPTS environment variable.

How it works...

To proceed, you will need the latest version of Tomcat 6 or Tomcat 7, a Java 6 (or Java 7) JRE or JDK, and a trial (or commercial) activated license. Free licenses don't allow you to run JRebel on standalone servers!

Once installed and configured, add the JRebel Java Agent to the startup parameters of Tomcat.

Tomcat is now configured to launch the JRebel Java Agent.

Launch Tomcat with the startup script and look at the console output or Tomcat logs. If JRebel is correctly launched, you will see messages that indicate your JRebel license is active. Otherwise, you have probably forgotten to register your license, or you have misspelled the JRebel Java Agent path.

The following is an example of the normal JRebel activation, with message displayed in Tomcat's default output:

JRebel: JRebel 5.3.1 (201307011846)

JRebel: (c) Copyright ZeroTurnaround OU, Estonia, Tartu.

JRebel:

JRebel: Over the last 1 days JRebel prevented

JRebel: at least 0 redeploys/restarts saving you about 0 hours.

JRebel:

JRebel: You are running with an evaluation license.

JRebel: You have 14 days until the license expires.

JRebel:

JRebel: You will see this notification until you obtain a

JRebel: full license for your installation.

Please note that Tomcat will display timestamps in its default output and logs. They have been removed from this example for visibility purposes.