admin管理员组

文章数量:1290955

I recently discovered the power of Hotswapping and want to implement this feature in my work project to reduce development time, especially when working with GUIs in a larger, more distributed project. I understand that Hotswapping doesn't work for adding method signatures, but it should be able to handle System.out.println, correct?

When I build my project with Gradle (4.5) and Java 8 (DCEVM fixed), it runs as expected, and debugging works fine. However, when I try to use the Hotswapping feature in IntelliJ, I encounter the following issues:

Adding a JMenu or JMenuItem and rebuilding doesn't work.

Adding a System.out.println("Hello World") results in the breakpoint showing up as "Ø" and the sysout string does not appear in the debugger. With Single Hotswap however, it gives me a red breakpoint but when rerunning the line by dropping the frame, it doesnt print the sysout either.

My General Question: Is it enough to use the internal IntelliJ Hotswap, or should I use the hotswapagent/hotswaphelper plugins as well? My thought was that IntelliJ's Hotswap together with a DCEVM-friendly JVM would be sufficient.

What I Tried:

Building the project using Gradle 4.5 and Java 8 with DCEVM fixed.

Running the project in IntelliJ IDEA and verifying that it works as expected without Hotswapping.

Attempting to add JMenu items and System.out.println statements and rebuilding in IntelliJ to test the Hotswapping feature.

Double checked IntelliJ config: * Reload classes after compilation = always, Gradle JVM: 1.8u181

What I Expected:

The project should rebuild successfully when using the Hotswapping feature in IntelliJ.

The JMenu or JMenuItem additions should appear in the running application as well as the sysout in the debugger.

Below are some photos:
1

2

3

本文标签: buildgradleIssues with Hotswapping in IntelliJ Using Gradle and Java 8 (DCEVM)Stack Overflow