Bug? Can run in debug mode only first time

yo3ggx

Active Member
Licensed User
Longtime User
I'm using B4J v10.30 on Windows 11 with the recommended java 19.0.2. If I try to run my app in debug mode, it works for the first time, then in any subsequent runs, the Compile and Rapid Debug (Build: GUI64) window remains empty and nothing happen. No issues at all in Release mode.
If I restart B4J, I can run again, but only first time.

What can be the root cause?

Thank you.
 

Cableguy

Expert
Licensed User
Longtime User
Too little info, unfiltered the logs and search for weird info related to your debugging app...
 

yo3ggx

Active Member
Licensed User
Longtime User
Too little info, unfiltered the logs and search for weird info related to your debugging app...
Is B4J. What do you mean by "unfiltered the logs"?
I observed that at first run I get the message "Waiting for debugger to connect" and then "Program Started".
Logging works as expected. Then if I stop debugging and start again, nothing displayed in the log, nor in the compiling window.
If I click on "Kill process" I get:
"[IDE message - 11:47:35]
An error occurred.
Failed to kill previous program"
so most probable something hangs when stopping debugging.
 

yo3ggx

Active Member
Licensed User
Longtime User
Something interesting. If I'm using javac.exe from openjdk version "21.0.6" 2025-01-21 LTS, no issue at all, only with the recommended 19.0.2.
 

Cableguy

Expert
Licensed User
Longtime User
You are right, B4J does not have "unfiltered" logs, only B4A does...
So, if I understand correctly, first run is OK, but subsequent are not, right?
What libs are you using? How are you "terminating" your first debug run?
My best guess is that you are using some lib that keeps a hold on some process and therefore, when restarting your app, the process is not re-started as it should
 

Cableguy

Expert
Licensed User
Longtime User
Something interesting. If I'm using javac.exe from openjdk version "21.0.6" 2025-01-21 LTS, no issue at all, only with the recommended 19.0.2.
Well, its only "recomended", not "you need to use"

Personally I use javafx 21.0.7
 

yo3ggx

Active Member
Licensed User
Longtime User
I supposed that if I use newer versions I may encounter issues. :)
To be even weird, an error in my app (captured anyway with a Try/Catch block) for which I was not able to find the root cause, disappeared completely with java 21. I have to double check, I may use some some libraries linked to my own library that are not fully compatible with java 19.
 

yo3ggx

Active Member
Licensed User
Longtime User
Seems that even in java21, the issue persist. No matter if I cleanly close the app or just stop debugging.
 

aminoacid

Active Member
Licensed User
Longtime User
Seems that even in java21, the issue persist. No matter if I cleanly close the app or just stop debugging.

Why don't you try a simple "Hello World" application and see if it happens. Then add the libraries you are using in your original app one-by-one until you can reproduce the issue.
 
Top