Oracle JDK 11安装程序& Windows上的JAR文件关联 [英] Oracle JDK 11 installer & JAR file association on Windows

查看:163
本文介绍了Oracle JDK 11安装程序& Windows上的JAR文件关联的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚在Windows 10上安装了Oracle JDK11.我注意到PATH变量不包含JDK 11路径.此外,.JAR文件扩展名也不与javaw关联.我们的用户过去双击JAR文件来执行客户端Java/SWING应用程序.在Java 11中,这不起作用.这是错误还是功能?我知道如何设置PATH并使用命令行手动启动应用程序.我只是想让最终用户更轻松.有什么想法吗?

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?

推荐答案

与以前的Java版本一样,Java 11中没有Public JRE.不要与以前的JDK版本中的jre目录混淆,它不是Public JRE.同样,旧的Public JRE的安装程序还将java.exejavaw.exe程序复制到默认情况下在PATH环境变量中定义的C:\Windows\System32目录中.他们还做了许多其他事情,例如Windows注册表中的更改.旧的Public JRE的安装程序从未更改PATH中的任何内容.

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.

Public JRE的官方替代品是一个自定义运行时环境,您可以通过 jlink 工具.但是,在这种情况下,除了UNIX shell和Batch脚本之外,您将没有jar文件.

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.

如果您不喜欢它,则可以使用JDK 11,并将Windows资源管理器中的jar文件与JDK的javaw.exe(而不是JRE)相关联,如

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

这篇关于Oracle JDK 11安装程序& Windows上的JAR文件关联的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆