It takes more than a minute for a project to start, and you have to restart it if you change a line of code? A hot loaded JVM plug-in for productivity is recommended: JRebel.

I’ve been using JRebel for a long time and it really saves me a lot of time, so I highly recommend it.

After installing the plug-in, you can see the JRebel option in the left toolbar of IDEA. Click and select the application that needs to use the JRebel plug-in, as shown in the figure below.

When checked, the DEBUG button with the JRebel logo appears in the DEBUG column of the current project, as shown below.

When we make changes to a class, if we want them to take effect immediately, we can right-click in the edit window of the current class And select Compile And Reload File, as shown below.

JRebel IDEA JRebel IDEA JRebel IDEA JRebel IDEA JRebel IDEA JRebel IDEA JRebel IDEA JRebel IDEA JRebel IDEA JRebel IDEA JRebel IDEA JRebel IDEA JRebel IDEA

Recommended reference this article crack tutorial, simple available: equal crack the easiest to use, link: https://juejin.cn/post/6844903950781677582.

After installing the plug-in, you can see the JRebel selection in the left toolbar of IDEA. Click and select the project that needs to use the JRebel plug-in, as shown in the figure below.

When checked, the DEBUG button with the JRebel logo appears in the DEBUG column of the current project, as shown below.

When we make changes to a class, if we want them to take effect immediately, we can right-click in the edit window of the current class And select Compile And Reload File, as shown below.

The official website emphasizes that JRebel is a JVM plug-in that implements hot loading. How is hot loading different from hot deployment?

  • Hot deployment:jvmProcess does not restart, reload the wholewebApplication;
  • Hot loading: Classes are reloaded at runtime.

The JVM’s support for multiple Web application deployments and redeployments has been restarted for Web applications, whereas JRebel uses hot loading to make changes take effect without restarting the application.

If you’ve ever done Android app development, there’s another word you’re probably familiar with: hotfix.

When I was doing Android application development in 2017, hot repair technology was very popular, such as hot representatives: Hand-Q space super patch technology, wechat Tinker, Alibaichuan HotFix. Hand-q-space super patch technology and wechat Tinker are implemented in principle by replacing the old dex (replacement class) with the new dex when the application is started, which takes effect only after the application is restarted. The HotFix launched by Alibaichuan is different from the former two, which can take effect immediately without restarting the application after the patch is pulled down.

Why are Hot fixes so hot in Android app development? Unlike WEB app updates, which are passively received by users, Android version updates require users to actively update. By using hot fix, users can passively accept updates, and dynamically fix bugs without anyone noticing when the APP restarts, optimize user experience, and reduce APP uninstallation rate.

As backend projects continue to become bloated, resulting in the initial time-consuming of many dependent frameworks, hot loading has been used to improve the efficiency of back-end development, and is used in back-end development debugging. There are, of course, hot loading implementations to fix online bugs, but in the era of containerized microservice deployments, this is no longer worthwhile.

You could argue that microservices are now less bloated, local debugging restarts are only a matter of seconds, and using it is less efficient. It’s not so easy to reboot if you need to re-log in or do some initialization.

While hot loading is useful, it saves us much of the rebooting time of rewriting code. But not all scenarios can use hot loading instead of reboots.

If we change Mybatis SQL, Spring annotations or configuration classes, we still need to restart the application. The reason is easy to understand, let’s take an application that relies on Spring and Mybatis framework as an example.

The first is to change the Spring configuration class or some annotations on the class and recompile the hot load to find that the changes do not take effect, because Spring only applies the configuration class when the container is started, reads the annotations on the class when the Bean class is scanned, and so on.

The second is Mybatis. No matter we modify Sql on annotations or Sql in XML files, it will not take effect, because when Mybatis is initialized, it needs to read Sql in XML files or Sql annotated on interface methods to generate proxy classes for the interface. Annotations or XML files will not be used later. Therefore, dynamic change does not take effect.

When it comes to Mybatis, the author find a IDEA plug-ins can solve the problem of modify SQL need to restart the application: 【 equal – mybatisplus – IDEA – the plugin 】 https://github.com/SweetInk/jrebel-mybatisplus.

I don’t know how JRebel works either, because I can’t find more information, and JRebel is not open source. If LET me realize a simple hot loading, I also have a simple IDEA. With the known knowledge of Java Agent and IDEA plug-in, I can complete the simple method code rewriting by dynamically reloading classes, and there will also be application scenarios. For example, you can repair null pointer exceptions found during debugging, service logic errors that do not involve other frameworks, and component logic errors to avoid excessive application restarts.

Only to find this paper introduces the principle of equal to achieve only a translation: “HotSwap and equal principle” https://www.bbsmax.com/A/gAJGemM3dZ/.