Java 如何在 Windows 中运行或安装 *.jar 文件?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3513206/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-14 01:25:13  来源:igfitidea点击:

how to run or install a *.jar file in windows?

javainstallerjarexecutable-jar

提问by brainless

I have downloaded jbpm-installer-3.2.7.jarbut I don't know how to install or run the file.

我已经下载,jbpm-installer-3.2.7.jar但我不知道如何安装或运行该文件。

If I double click on it, it opens in winrar. I tried installing through command prompt, but I got the following errors:

如果我双击它,它会以winrar. 我尝试通过命令提示符安装,但出现以下错误:

C:\Documents and Settings\ccuser\Desktop\manoj>java -jar jbpm-installer-3.2.7.jar

Exception in thread "main" java.lang.UnsupportedClassVersionError: com/izforge/izpack/installer/Installer (Unsupported major.minor version 49.0)
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.access0(Unknown Source)
    at java.net.URLClassLoader.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)

采纳答案by user85421

The UnsupportedClassVersionErrormeans that you are probably using (installed) an older version of Java as used to create the JAR.
Go to java.sun.com page, download and install a newer JRE (Java Runtime Environment).
if you want/need to develop with Java, you will need the JDK which includes the JRE.

UnsupportedClassVersionError意味着您可能正在使用(安装)旧版本的 Java 来创建 JAR。
转到java.sun.com 页面,下载并安装较新的 JRE(Java 运行时环境)。
如果您想/需要使用 Java 进行开发,您将需要包含 JRE 的 JDK。

回答by Tom

Have you tried (from a command line)

你有没有试过(从命令行)

java -jar jbpm-installer-3.2.7.jar

java -jar jbpm-installer-3.2.7.jar

or double clicking it with the mouse ?

还是用鼠标双击它?

Found thisand thisby googling.

通过谷歌搜索找到了这个这个

Hope it helps

希望能帮助到你

回答by Dean

To run usually click and it should run, that is if you have java installed. If not get java from hereSorry thought it was more general open a command prompt and type java -jar jbpm-installer-3.2.7.jar

要运行通常单击它应该运行,也就是说,如果您安装了 java。如果没有从这里获取 java 抱歉认为它更通用打开命令提示符并键入java -jar jbpm-installer-3.2.7.jar

回答by mocybin

Open up a command prompt and type java -jar jbpm-installer-3.2.7.jar

打开命令提示符并键入 java -jar jbpm-installer-3.2.7.jar

回答by Serplat

If double-clicking on it brings up WinRAR, you need to change the program you are running it with. You can right-click on it and click "Open with". Java should be listed in there.

如果双击它会出现 WinRAR,则您需要更改运行它的程序。您可以右键单击它,然后单击“打开方式”。Java 应该列在那里。

However, you must first upgrade your Java version to be compatible with that JAR.

但是,您必须首先升级 Java 版本以与该 JAR 兼容。