简体   繁体   English

无法运行JAR文件

[英]Can't run JAR file

I have a finished program that I created a JAR executable from (I created this in eclipse), and I need to download this executable onto computers different from the one that I wrote the program on. 我有一个完成的程序,可以从中创建一个JAR可执行文件(我在eclipse中创建了该文件),并且需要将该可执行文件下载到与编写该程序的计算机不同的计算机上。

However, I am getting the problem that when I try and download the executable onto the computers, I get the window that pops up that says that "Windows can't open this file" and it then gives me a list of programs that I can open the file with, none of which I can use. 但是,我遇到的问题是,当我尝试将可执行文件下载到计算机上时,出现弹出窗口,提示“ Windows无法打开该文件”,然后提供了我可以使用的程序列表。打开文件,我都无法使用。 I do not need to do this on the computer on which I wrote the program. 我不需要在编写程序的计算机上执行此操作。 When I double-click the executable on that computer, the program starts without any trouble. 当我双击该计算机上的可执行文件时,该程序启动就没有任何麻烦。

In order to run Java programs, you have to install the Java Runtime Environment (JRE). 为了运行Java程序,您必须安装Java Runtime Environment(JRE)。 The Java Development Kit (JDK) is not needed. 不需要Java开发工具包(JDK)。 You can download the latest version (JRE) here . 您可以在此处下载最新版本(JRE)

If you want to learn more about JVM, JRE and JDK, you can read the answer to this question . 如果您想了解有关JVM,JRE和JDK的更多信息,可以阅读此问题的答案。

这是因为您需要在包括JDK在内的远程计算机中安装Java,然后还需要通过控制台安装Ant使Java在任何适用的地方可用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM