I tried all above steps to resolve the problem but nothing worked. I had installed both JDK and JRE.
In my case, one jar file was being opened by double click while other was not being opened. I examined those files and the probable reason was that which was being opened, was created using JAVA SE 6 and the one not being opened was created using JAVA SE 7. Although, the problematic jar file was being run via command prompt (java -jar myfile.jar).
I tried Right Click -> Properties -> Change to javaw.exe with both in JDK\bin directory and JRE\bin directory.
I was finally able to fix the problem by changing javaw.exe path (from JDK\bin to JRE\bin) in registry editor.
Go to HKEY_CLASSES_ROOT\jarfile\shell\open\command, the value was,
"C:\Program Files\Java\jdk-11.0.1\bin\javaw.exe" -jar "%1" %*
I changed it to,
"C:\Program Files\Java\jre1.8.0_191\bin\javaw.exe" -jar "%1" %*
and it worked. Now the jar file can be opened by double click.