On the other hand with Hybris, it is always necessary to rebuild the source code in bytecode. Subsequently, restarting the Hybris server to load the changes.
Building Hybris project usually takes 20 minutes and restarting server on windows machine takes around 25 to 35 minutes. Even if one-line code change is done, developer has to wait for around an hour to see the output of the changes.
What is the solution to this problem?
Many Hyrbis developers are aware of JRebel. JRebel fast tracks Java application development by skipping the time-consuming build and server restart steps in the development process. JRebel helps developers to be more productive by viewing code changes in real time and maintaining state.
In simple words JRebel loads the code changes in the live running server, server restart is not required at all.
Problem with JRebel is, it is not free to use and pretty expensive.
Free and open source alternative to JRebel is HotSwap.
What is HotSwap?
HotSwap is free and open source alternative to JRebel. HotSwap does exactly the same thing what JRebel does, i.e. loading the code changes directly in the running server. Server restart is not required for each code change.
In contrast to standard Java, where the HotSwap is limited to in-body code changes, the DCEVM + HotswapAgent allow following code changes:
To launch DCEVM on Windows: Start > cmd > right click > Run As Administrator and use: java -jar <downloaded jar file>g. java -jar installer-light.jar. Select required java installation directory from the dialog box and press “Install DCEVM as altjvm” button. Java 1.7+ versions are supported. Make sure that CMD have write access(Run as Administrator) to the java installation directory. Look at the below screenshot for reference.