无法通过双击打开 .jar 文件。

huangapple go评论70阅读模式
英文:

Can't open .jar files with double click

问题

我最近在学习Java,我需要能够打开.jar文件,但在命令提示符之外,我无法再打开它们。.jar文件没有图标(实际上有一个图标,只是一个白色的方块),当我双击它时,会提示我选择如何打开。我已经尝试了一些方法,用java.exe打开它,但它立即关闭了。

英文:

I've been learning java recently and I need to be able to open .jar files, but outside of cmd, I can't anymore. .jar files just don't have an icon (it does, it's just a white square) and when i double click it, it prompts me to open as. I've followed a few things and opened it with java.exe, but it just closed down instantly.

答案1

得分: 1

为在Windows中打开一个jar文件,你必须安装Java运行环境。或者,你可以使用解压缩软件,比如解压实用程序,来查看jar存档中的文件。

如果jar文件在诸如WinRAR或7-Zip之类的存档程序中打开,并且你希望改为使用Java打开它,请按照以下说明操作。(这些步骤要求jar文件中包含可执行的Java代码。)

1-右键单击该文件,然后选择“打开方式”。
2-在“打开方式”窗口中,点击“浏览”按钮,以打开文件资源管理器窗口。
3-你需要在计算机硬盘驱动器上找到Java可执行文件(java.exe文件)。它通常位于“Program Files\Java”或“Program Files (x86)\Java”文件夹中,可能在Java文件夹下面的子文件夹中。找到该文件后,选择它并点击“确定”。

英文:
To open a jar file in Windows, you must have the Java Runtime Environment installed. Alternatively, you can use decompression software, such as an unzip utility, to view the files in the jar archive.

If the jar file opens using an archive program, such as WinRAR or 7-Zip, and you want Java to open it instead, follow the instructions below. (The jar file must contain executable Java code for these steps to work.)

1-Right-click the file and select Open With.
2-In the Open With window, click the Browse button to open the File Explorer window.
3-You need to find the Java executable file (java.exe file) on your computer hard drive. It is often located in the "Program Files\Java" or "Program Files (x86)\Java" folder, within a possible subfolder below the Java folder. Once you find the file, select it and click OK.

答案2

得分: 0

如果您只需要打开这个jar文件,您可以使用文件解压工具,比如7-Zip,来查看其中包含的内容。

英文:

If you just need to open the jar file, you can use a file decompressor like 7-Zip to see the contents that are inside.

huangapple
  • 本文由 发表于 2020年8月28日 02:33:53
  • 转载请务必保留本文链接:https://go.coder-hub.com/63622239.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定