简体   繁体   English

运行一个可执行的 Java jar - 高版本 vs 低版本?

[英]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.

相关问题 较低版本的应用未在android的较高版本中运行 - Lower version app not running in the Higher version in android 如何将较低版本的Java编译并运行到较高版本? - How to compile and run lower version java to higher version? 在不同的Java版本中运行带有depedency jar的jar - Running a jar with depedency jar at a different java version 较高Java版本创建的Java对象可以在较低Java版本中运行吗 - Can a Java Object created by higher Java version run in a lower Java version Android App无法在更高版本上运行 - Android App not running on higher version 在onUpgrade中处理较低版本的数据库和较高版本的数据库 - Handling lower version database and higher version database in onUpgrade 无法从 bash 脚本执行 java 类,也无法将 java_home 更新到更高版本,并在低于提到的版本中编译该类 - cannot execute java class from bash script and also updatd the java_home to higher version and compiled the class in the lower version than mentioned 创建低版本的Runnable jar文件 - Creating Runnable jar file of lower version Java jar版本 - Java jar version IntelliJ运行错误版本的SpringBoot-mvn和Java jar正常工作 - IntelliJ running wrong version of SpringBoot - mvn and java jar work correctly
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM