java 我可以在没有 JDK 的情况下运行 .jar 文件吗?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13592123/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Can I run a .jar file without JDK?
提问by Tushar Monirul
Possible Duplicate:
How can I convert my Java program to an .exe file?
Is it possible to run a jar file in a PC without installing JDK or JRE SDK? Converting to exe or any other way?
是否可以在不安装 JDK 或 JRE SDK 的情况下在 PC 中运行 jar 文件?转换为 exe 或任何其他方式?
回答by Omid Mafakher
Run jar file in .Net => http://www.ikvm.net/(Another VM for java)
Or you can convert java to exe Using: http://www.duckware.com/jexepack/index.html
by the way you can use gcc.gnu.org/java ("GCJ" another compiler of Gcc Gnu) to compile java in standalone executable file
在.net =>运行jar文件http://www.ikvm.net/(另一个VM为Java),
或者你可以将Java exe文件使用:http://www.duckware.com/jexepack/index.html
由您可以使用 gcc.gnu.org/java(“GCJ”Gcc Gnu 的另一个编译器)在独立可执行文件中编译 java 的方式
回答by eis
A jar file is a java archieve. A JRE is runtime environment for such a file, which it depends on. Without any kind of java runtime environment, you cannot.
jar 文件是一个 java 档案。JRE 是此类文件的运行时环境,它依赖于它。没有任何类型的 Java 运行时环境,您就不能。
However though, there are lot of environments that already have it, so you don't necessarily have to separately install it.
但是,有很多环境已经拥有它,因此您不必单独安装它。
JDK/SDK is not needed.
不需要 JDK/SDK。
Note that converting jar file to an exe won't change the fact that it still needs java runtime environment to run.
请注意,将 jar 文件转换为 exe 不会改变它仍然需要 java 运行时环境才能运行的事实。
回答by Peter Lawrey
You don't need an "JDK" or "JRE SDK" but you will need a "JRE" minimum. You can convert it to an EXE but you still need to inlcude libraries which have all the same information that a JRE would.
您不需要“JDK”或“JRE SDK”,但至少需要“JRE”。您可以将其转换为 EXE,但您仍然需要包含与 JRE 具有相同信息的库。
E.g. With a VC++ you need the runtime library for that version to run such a program.
例如,对于 VC++,您需要该版本的运行时库来运行这样的程序。