Display.getVersion() is broken (returns NULL) after compiling but works before?

Hi, I found out after pulling my hair for 1 hour that this silently returns NULL on compiled applications, but works perfectly inside the IDE:


I decided to use the direct approach instead, which works perfectly under all circumstances:


But is this a bug that Display.getVersion() only works inside the SDK?

Are you calling this in simpleInit() or are you calling it from main()?

…note: the display has not been initialized until the app has been started.

Hi, first, thank you for responding and sorry for not replying sooner, I do not receive emails from this forum anymore since 1-2 weeks, not sure what’s happening.

I tried to call this in simpleInit and it did not raise any exception. It just returned NULL on the compiled app, it was returning correct values inside the IDE. It’s like the compiled app does not have the same function implemented or is missing something for this function to return a correct value.

I don’t know what to tell you. I do exactly this in Mythruna (after that app is started):
this.adapter = Display.getAdapter();
this.driverVersion = Display.getVersion();

…and it works fine for all the cards I’ve seen that work at all.

There shouldn’t be any difference between running the code in the IDE or running the raw app. They both start java.exe like anything else. If you really want to be sure you can turn off “Compile on Save” in the project settings. Then running your app in the IDE is always identical to running it outside the IDE. The classpath may vary but that’s it.