Improve development Efficiency-jrebel plug-in installation

Source: Internet
Author: User
Tags tomcat server netbeans
What is Jrebel?Jrebel installs a javaagent monitoring system in the classes and resources files in the workspace and then heats these changes on the running Application server, supporting these types of file changes below: Changing the Java classes file. Change the framework configuration file (e.g. Spring XML files and annotations, Struts mappings, etc). Any static resource files (e.g. JSPs, htmls, Csss, xmls,. Properties, etc)

JRebel is a time-saving tool that can heat-load changed code without restarting the container or republishing the application. A jvm-javaagent plug-in.-javaagent is a command-line property after Java5, and Jrebel is installed using Plug-ins.

JRebel is not an IDE plug-in. The IDE plug-in is provided to improve the user experience, and JRebel is as available as the normal Java compiler and text editor. A framework. Jrebel will not introduce any dependencies into your application. You can remove it anytime, without affecting your development. An application server. Jrebel can work on all the best application servers. A custom JVM. Jrebel does not need to change the JVM, it can work on all the outstanding virtual machines based on the JVM implementation.
To put it simply, it is a plug-in of the JVM that acts as a Java class loading agent to monitor the changes in the. class file in the file system to help implement the thermal loading of the class. During the development process, you can save a considerable amount of time for Tomcat restart. The annual statistics will save about 3-7 weeks (official data). With it, you can write like PHP code, while modifying the edge of the test!


How does Jrebel work?

JRebel integrates with the JVM and application servers mainly at the class loader level. It does not create any new class loaders, instead, it extends the existing ones and the ability to manage reloaded S.

When a class is loaded JRebel'll try to find a corresponding. class file for it. It'll search from the classpath (including a application classpath, like web-inf/classes) and from the places specified In the Rebel.xml configuration file. If it find A. class file JRebel instruments the loaded class and associates it with the found. class file. The. class file timestamp is then monitored to changes in the loaded class and updates are propagated the through D class loader, to your application.
JRebel can also monitor. class files in JARs if they are specified in Rebel.xml.

Importantly, when loading updates to a class, JRebel preserves all of the existing of this class. This is allows the application to just continue working, but also means then when adding a new instance field it won't be Initialized in the existing instances, since the constructor won't be rerun.

Some Common Misconceptions:jrebel just wraps class loaders around classes. in fact JRebel does not add a single new class loader to your application. The solution of reloading Java classes by wrapping them in throwaway classloaders is a well-known one, but unfortunately a LSO very limited. The problem is this unless you also throw away all of the instances of the classes loaded by said class loaders, the code would not reload. However throwing away those instances is only possible if they are-somehow by the framework, managed. As it's done in Tapestry 5. JRebel just uses instrumentation API. The instrumentation API is introduced in Java 5 and included a limited ability to redefine Java classes. Unfortunately it is limited to a changing method bodies (as is hotswap) and also suffers from several additional , which makes it isn't too useful in a real environment. JRebel Agent does use it to instrument the application Server class loaders and other basic CLasses, but the API does not play part in the actual reloading process.

install Eclipse Jrebel plug-in 1.1 Introduction

JRebel IDE plugins are available for Eclipse, IntelliJ Idea and NetBeans and provide the following Features:debugger ORT for debugging the application with JRebel agent enabled. necessary to set breakpoints, inspect expressions and step through code.  The Running with JRebel Support is enabled for starting the application or the IDE with the withing agent. [Missing in NetBeans and IntelliJ idea before 8.x] rebel.xml generation Support for generating the Rebel.xml configuration  File from the IDE project definition. [Missing in NetBeans and IntelliJ idea before 8.x]
1.2 Eclipse

Install the JRebel Eclipse plugin into Help» Install New Software ... and enter the following URL:
http://www.zeroturnaround.com/update-site/

Offline installation package Download address:
Http://www.zeroturnaround.com/update-site/update-site.zip



If you do not choose to embed Jrebel, you need to manually fill in the actual path of the Jrebel.jar system. Enter Window » Preferences » JRebel A see the following figure and enter the Jrebel.jar path




You need to set up debugging to enter Window»preferences and then to Java»debug»step filtering.

Select Use Step Filters, Filter synthetic methods and step through Filters. Now select all the default filters and click the Add Filter button to add com.zeroturnaround.* and org.zeroturnaround.*.


Enter Project»build automatically confirmation to be selected.




Eclipse Tomcat Settings

2.2 Eclipse

No automatic publishing is required in the TOMCAT server configuration. Double-click the server name to open the Server Configuration page to select Never Publish automatically and (Enable JRebel agent).

If you run a standalone application server, you can choose Enable JRebel Agent.




Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.