Oracle JDK 11 installer & JAR file association on Windows

stepand76 :

I just installed Oracle JDK 11 on my Windows 10. I noticed that the PATH variable doesn't include the JDK 11 path. Also the .JAR file extension is not associated with javaw. Our users used to doubleclick JAR file to execute the client Java/SWING application. With Java 11 this doesn't work. Is this a bug or feature? I know how to set the PATH and start the application manually using the command line. I just want to make it easier for end-users. Any ideas?

Rostislav Krasny :

There is no Public JRE in Java 11, as there was in the previous Java versions. Don't be confused with the jre directory in previous JDK version, it's not a Public JRE. Also installers of the old Public JRE copied the java.exe and the javaw.exe programs into the C:\Windows\System32 directory that is defined in the PATH environment variable by default. They also did many other thing, like changes in your Windows registry. Installers of the old Public JRE had never changed anything in the PATH.

Official alternative to the Public JRE is a custom runtime environment that you can built by the jlink tool of the JDK. However in this case you will have no jar file at all but UNIX shell and Batch scripts.

If you don't like it you may use JDK 11 and associate the jar files in Windows Explorer with javaw.exe of JDK, instead of JRE, as described there Running JAR file on Windows

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=115497&siteId=1