使用特定 JRE 运行 JAR 文件 [英] Run a JAR file using a specific JRE

查看:20
本文介绍了使用特定 JRE 运行 JAR 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法在 Windows 上使用位于特定文件夹中的 JRE 运行 JAR 文件?类似于 Eclipse 在您提供的某些路径中查找其 JRE 的方式.一些 Windows 可执行代码(C 或 C++)或批处理文件都可以完成这项工作.谢谢!

Is there a way on Windows to run a JAR file using a JRE located in a specific folder? Similar to the way Eclipse looks for its JRE in some path you give to it. Either some windows executable code (C or C++) or a Batch file will do the job. Thanks!

推荐答案

一个 JRE 目录有一个 bin/java.exe.

A JRE directory has a bin/java.exe.

你可以简单地从那个 JRE 运行一个 jar

You can run a jar from that JRE simply with

<path_to_jre>/bin/java.exe -jar Executable.jar

如果您不想每次都打开控制台,只需将上面的行放在一个 .bat 文件中,然后双击它.

If you don't want to have to open a console each time, simply put the above line in a .bat file and double click on that.

这篇关于使用特定 JRE 运行 JAR 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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