The main question is, if somebody knows exactly whats the difference in windows 10 between simply calling “java -jar …” or “java.exe -jar”.
Reason behind this question, since updating my rig (including a new gtx1060 card) I got this exception:
SEVERE: Failed to create display
org.lwjgl.LWJGLException: Pixel format not accelerated
at org.lwjgl.opengl.WindowsPeerInfo.nChoosePixelFormat(Native Method)
at org.lwjgl.opengl.WindowsPeerInfo.choosePixelFormat(WindowsPeerInfo.java:52)
at org.lwjgl.opengl.WindowsDisplay.createWindow(WindowsDisplay.java:247)
at org.lwjgl.opengl.Display.createWindow(Display.java:306)
at org.lwjgl.opengl.Display.create(Display.java:848)
at org.lwjgl.opengl.Display.create(Display.java:757)
at com.jme3.system.lwjgl.LwjglDisplay.createContext(LwjglDisplay.java:143)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:113)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:211)
at java.lang.Thread.run(Unknown Source)
Most probably some of you might either say driver issue, or something in my application. So I reduced my application to this:
(new SimpleApplication() {
@Override
public void simpleInitApp() {
}
}).start();
and still got the same exception (Btw - always after confirming the settings dialog, doesn’t matter what is selected).
I was already a little bit down, because I thought its because of the driver from the new graphics card, when it suddenly was working again.
But because I was not aware of having changed anything I tried to track the reason down and came up to a reproducable test case (at least on my system):
When starting the application using exactly this command:
java -jar srb-game-client-1.0.0-SNAPSHOT.jar
it crashed with the exception from before.
But when calling it with this:
java.exe -jar srb-game-client-1.0.0-SNAPSHOT.jar
it is working! Same working directory, same path, same environment, same session (command shell)… Really checked it at least 10 times, because I could not believe that its working just because of including the extension of the java vm…
And now I am kind of stuck. I checked -version for both variants: w/ and w/o the extension and both print the same information:
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
I already was thinking of maybe there is a java.bat somewhere in the path which is executed instead of the java.exe and causes the problems, but found none…
Does somebody have an idea - I mean its quite easy for me to fix it by just calling java.exe instead, but I really want to understand this…