Coder Social home page Coder Social logo

ericseokgon / hotswap-agent-intellij-plugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dmitry-zhuravlev/hotswap-agent-intellij-plugin

1.0 1.0 0.0 93 KB

This plugin intends to simplify the usage of http://hotswapagent.org. Agent provides real hotswap functionality together with https://dcevm.github.io which extends JVM class redefinition functionality.

License: Apache License 2.0

Kotlin 94.56% Java 5.44%

hotswap-agent-intellij-plugin's Introduction

HotSwapAgent-IntelliJ-IDEA-plugin

hotswaplogo

HotSwapping

Our work is fun, but we don't want to waste our time waiting when our latest changes will be deployed on application server!

You can reload classes changed during debugging without need to restart the entire application using the HotSwap mechanism Command+Shift+F9 in IntelliJ IDEA.

jvm_hotswap_ok

BUT! At the moment due to original limitations of Java SDK the HotSwapping is possible ONLY if the method body is altered.

In all other cases (like changing method or class signature), the class reload is impossible and the corresponding error message appears.

jvm_hotswap_fail

Solution

We need to use special java agent together with our JVM to enhance ability of reloading of changed classes. For example:

  1. JRebel (too expensive $550 ๐Ÿ˜จ per year per user)
  2. Spring-Loaded (cannot work properly with java 8 and crash JVM ๐Ÿ˜ต)
  3. DCEVM (free-opensource-reallyhot ๐Ÿ˜€)

We will choose: DCEVM + Hotswap Agent ๐Ÿ‘

DCEVM Installation

steps:
1. Download latest release of DCEVM Java patch and launch the installer with sudo(e.g. sudo java -jar DCEVM-light-8u51-installer.jar). Currently you need to select correct installer for Java 8.
2. Select java installation directory on your disc and press "Install DCEVM as altjvm" button. JDK version 1.8.0_45 is recommended. download here
DCEVM
3. Download latest release of Hotswap agent jar, unpack hotswap-agent.jar and put it anywhere on your disc. For example: C:\java\hotswap-agent.jar
4. Installation is done!
5. More info here

Start with HotSwapAgent plugin for IntelliJ IDEA.

steps:
1. Install HotSwapAgent plugin for IntelliJ IDEA.
plugin
2. Enable HotSwapAgent plugin for all configurations (or one by one).
enable
3. Start the application in DEBUG mode. You will see HOTSWAP AGENT notification in your console in case if setup was correctly done.
notnotification
4. Be sure that you have "Reload classes after compilation: Always" ON in IntelliJ IDEA in HotSwap section in your IDEA preferences.
image
5. To re-deploying changed classes in IDEA press keys combination (๏ฃฟ: Command+Shift+F9/ โŠž: Ctrl+Shift+F9) to compile the current file

โ„น๏ธ Instead of compiling the classes manually you can use the Save Action plug-in, which can trigger the compilation automatically and thus enabling "hotswap on save".

Happy:heart: Hot Swapping!

1. change method name & then press (๏ฃฟ: Command+Shift+F9/ โŠž: Ctrl+Shift+F9)
change_01
2. add new method & then press (๏ฃฟ: Command+Shift+F9/ โŠž: Ctrl+Shift+F9)
change_02

More info: DCEVM & HotswapAgent

hotswap-agent-intellij-plugin's People

Contributors

dmitry-zhuravlev avatar hibissscus avatar markiewb avatar

Stargazers

Eric avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.