[英]Running an executable Java jar - Higher Version vs Lower Version?
I have created a program and trying to covert it an executable jar.我创建了一个程序并试图将它转换为一个可执行的 jar。 I created the executable jar via eclipse - runnable jar.我通过 eclipse - runnable jar 创建了可执行 jar。 The installed JDK in my machine is Java 1.8我机器上安装的JDK是Java 1.8
If i forward this jar to others, do they need JDK 1.8 runtime libraries or JDK 1.8 version in their system to execute the jar?如果我将此 jar 转发给其他人,他们的系统中是否需要 JDK 1.8 运行时库或 JDK 1.8 版本才能执行该 jar?
What is the minimum requirement in their system?他们系统的最低要求是什么?
Thanks.谢谢。
If the the versions of the compiled classes are 52.0
, so they are for Java 8, then the minimum requirement is JRE 8. Java is backward compatible , not forward.如果编译类的版本是52.0
,所以它们是针对 Java 8 的,那么最低要求是 JRE 8。Java 是向后兼容的,而不是向前兼容的。
However, you can use the Java compiler to produce code with older class versions, then the program can be run with older JRE.但是,您可以使用 Java 编译器生成具有较旧类版本的代码,然后可以使用较旧的 JRE 运行该程序。 Of course, in this case you cannot use features not existing in the older Java version.当然,在这种情况下,您不能使用旧 Java 版本中不存在的功能。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.