HotswapProjects / HotswapAgent

Java unlimited redefinition of classes at runtime.
GNU General Public License v2.0
2.33k stars 491 forks source link

Add Intellij HotSwapHelper plugin. #577

Closed gejun123456 closed 1 month ago

gejun123456 commented 1 month ago

Add Intellij HotSwapHelper plugin in IDE part.

skybber commented 1 month ago

Thanks!

homejim commented 1 month ago

@gejun123456 Thasnks!! I tried using this plugin and read some of the code. I think it is somewhat difficult for a new user to use, and there is room for improvement. My understanding of the plugin's functionality is:

  1. It automatically adds parameters like -XX:HotswapAgent=fatjar and -XX:+AllowEnhancedClassRedefinition based on the original configuration.
  2. It specifies the hotswap-agent.jar and adds the output results.

However, the user still needs to do quite a few things:

  1. Understand DCEVM, and download and install the JDK themselves.
  2. Specify the JDK during runtime.
  3. It seems that the hotswap-agent.jar cannot be specified manually? What if I want to upgrade it? Do I need to manually overwrite it in C:/tmp/HotSwapAgent/?

Maybe you could consider optimizing these aspects.

skybber commented 1 month ago

@gejun123456 @homejim I recommend using -XX:HotswapAgent=external. This option --add-opens all JDK modules that HotswapAgent requires to be opened. Additionally, use the standard Java agent argument -javaagent:<path_to_latest_ha>/hotswap-agent.jar. If an external agent is used, the user (or HotswapHelper plugin) can place HotswapAgent anywhere where has access and is not restricted by the OS access rules, as if JBR is placed in a system directory like /usr/lib/jvm/jbr21/.

gejun123456 commented 1 month ago

@homejim @skybber Thanks for the suggestion, the plugin will support user configure agent manually in later versions. For downloading jdk, i think it's easyier for user to use, or user has to manully search the jdk and install DCEVM.

gejun123456 commented 1 month ago

image Manually set jar file is supported, thanks. will add more feature in later versions. HotSwapHelper-1.0.2.zip