Notice: Undefined offset: 16343563 in /var/www/html/qa-external/qa-external-users.php on line 744
Code works in debug mode but not in normal run. - OnlineGDB Q&A
Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

Code works in debug mode but not in normal run.

+4 votes
asked Jun 1, 2025 by Hex Hands (190 points)
I have a game with multiple files that prints out nothing, an empty terminal, when I hit the normal run buttons. However, if I click debug mode, the game works perfectly. Why does this happen?

https://onlinegdb.com/rD5tWweFN

Thanks!

1 Answer

0 votes
answered Jun 3, 2025 by Jerry Jeremiah (2,040 points)
selected Jun 4, 2025 by Hex Hands
 
Best answer
It does run - eventually.

When I run it the black screen appears and then 20 cursor blinks later the text appears.

I don't know what is taking all that time - if I replace your 'new coreGame()' with 'System.out.println("1")' it still takes many cursor blinks before it prints the text.

Maybe it is trying to make a JVM or something and isn't actually running your code.
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and receive answers from other members of the community.
...