I am not sure if this is just me and the way I did 2 fresh installs but the most basic LibGDX desktop app exits with a non zero exit value of -1. The reason seems to be that forceExit in LwjglApplicationConfiguration is set to true on default and thus this line on LwjglApplication is being called:
if (graphics.config.forceExit) System.exit(-1);
Which triggers to following exit log:
> Task :desktop:DesktopLauncher.main() FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':desktop:DesktopLauncher.main()'.
> Process 'command 'C:/Program Files/Java/jdk1.8.0_221/bin/java.exe'' finished with non-zero exit value -1
If I manually set config.forceExit to false it seems to shut down fine. But why does it run like this on default? The comment /** whether to call System.exit() on tear-down. Needed for Webstarts on some versions of Mac OS X it seems **/ is not a reason to set it default to true imho. It took me a while to fix this and I could not find any similar issues on internet so I am wondering if I am the only one and if this is the real reason/proper fix for this issue? It happens on both my desktop (fresh reinstall) and a somewhat older laptop (fresh install).