如何设置jar应用程序以使用Java 6而不是7 [英] How to set jar application to use Java 6 instead of 7

查看:153
本文介绍了如何设置jar应用程序以使用Java 6而不是7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何设置我的java jar应用程序使用jre 6而不是jre 7?
我这样做是因为如果应用程序使用jre 7,我正在使用的库存在一些兼容性问题。

How can I set my java jar application to use jre 6 instead of jre 7? I'm doing this because there are some compatibility issue with the libraries I'm using if the application use jre 7.

编辑:
该应用程序将带有自己的安装程序(使用高级安装程序),该安装程序具有jre6安装程序。但我不知道如何跟踪jre6的安装文件夹。
如何跟踪它并使jar文件使用jre6?

The application will come with its own installers (using advanced installer) that have a jre6 installer. But I don't know how to trace the installation folder of the jre6. How can I trace it and make the jar file use the jre6?

推荐答案

使用java运行应用程序时。 exe,您可以提供Java 1.6安装的绝对路径。类似于:

When running your application using java.exe, you could provide the absolute path to a Java 1.6 installation. Something like:

absolute_path_to_java6_dir/bin/java -jar yourRunnableJar.jar

absolute_path_to_java6_dir/bin/java -cp .;yourJar.jar;otherJarFiles className

这篇关于如何设置jar应用程序以使用Java 6而不是7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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