Hello Guest

[solved] 'compile on save' - Apache Netbeans 10 ?

  • 3 Replies
  • 395 Views
*

Offline sc

  • *
  • 15
[solved] 'compile on save' - Apache Netbeans 10 ?
« on: November 22, 2019, 09:20:23 »
I'm trying to use hot code swap, so that I don't have to restart my entire application when I make small changes to the code ... but it doesn't seem to work.

This is what I have tried so far :
* project > properties > compile : Compile on save=ON
* tools > options > java > debugger > general : apply code changes after save=ON
* run project in debug mode, with or without breakpoints
* change position of a game item, change color of a lamp > save > no effect inside the game window ...

* I also tried 'HotSwapAgent' (http://hotswapagent.org/)

Anybody have any ideas ??? It seems simple enough, but maybe I'm doing something wrong ?
« Last Edit: November 22, 2019, 17:30:29 by sc »

*

Offline KaiHH

  • ****
  • 216
Re: 'compile on save' - Apache Netbeans 10 ?
« Reply #1 on: November 22, 2019, 11:21:20 »
Where exactly do you "change position of a game item". What exactly do you mean by that.
HotSwap can only change the code in a method or constructor.

*

Offline sc

  • *
  • 15
Re: 'compile on save' - Apache Netbeans 10 ?
« Reply #2 on: November 22, 2019, 12:06:23 »
I've tried different places, but all inside methods.
For instance, I tried changing the glClearColor() in the render method.

*

Offline sc

  • *
  • 15
Re: 'compile on save' - Apache Netbeans 10 ?
« Reply #3 on: November 22, 2019, 17:29:54 »
OK. I think I have it working now ...
If anyone is interested :

* project > properties > compile : Compile on save = OFF
* tools > options > java > debugger > general : Apply code changes after save = OFF

After you make some code changes : save the file. Press 'apply code changes' button (3 green squares next to 'run to cursor' button) ... et voila !

Remember :
* ONLY for code that is referenced in main game loop !!!!!
* ONLY for code that is running in debug mode !!!!!
* ONLY for modification of existing methods (no new method, new variable, new class creation) !!!!!

I am using Apache NetBeans 11 with OpenJDK 11 (proj > props > libr : JDK11), but it will most likely work for older versions as well.