HotSwap Java code in IntelliJ


I’m struggling to find a way to modify java code at runtime.

ATM, my configuration looks like this :
C:\java\jdk\jdk8u345-b01\bin\java.exe -agentlib:jdwp=transport=dt_socket,address=,suspend=y,server=n -javaagent:C:\Users\x\AppData\Local\JetBrains\IntelliJIdea2023.1\groovyHotSwap\gragent.jar -javaagent:C:\Users\x\AppData\Local\JetBrains\IntelliJIdea2023.1\captureAgent\debugger-agent.jar -Dfile.encoding=UTF-8 -classpath C:\Users\x\AppData\Local\Temp\classpath523376331.jar --port 8080 --config build\tomcat\

In the project, there is the external library hotswap-agent-tomcat-plugin-1.3.0.jar that is supposed to do exactly what I want but dunno how to get it working. I tried to pass arg -javaagent:PATH\TO\JAR\agent.jar

The project is at version 6.1.12 AOS ; 5.4.10 AOP

Anybody ever achieved java hotswap successfully on Axelor app in IntelliJ ?

Let’s talk about this must have feature ! :slight_smile:

To summarize, what i’m trying to do is starting a server from my sources and modify on the fly the body of java methods.

Anybody has ever achieved this ? I’m loosing so much time some day restarting the server (10 minutes to restart on my computer)

PS : IntelliJ ultimate on Windows & java 8 (still on 6.x.x)

Hello! What do you want to achieve ?

Automatically injecting body method modifications at runtime a.k.a. hotswap.

I am not really sure, I think you can achieve it using Idea ultimate (however it has a cost)