Java 开发工具包中的 jar.exe 在哪里? [英] Where is jar.exe in Java Development Kit?

查看:49
本文介绍了Java 开发工具包中的 jar.exe 在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从 下载并安装了 JDKJava SE 开发工具包 7 下载在c:\jdk.1.7.0"中,设置变量路径为c:\jdk.1.7.0",但使用命令例如:

I downloaded and installed JDK from Java SE Development Kit 7 Downloads in "c:\jdk.1.7.0", set variable path to "c:\jdk.1.7.0", but using command for example:

jar xvf ..\src.zip

给我这个错误:

'jar' is not recognized as an internal or external command,
operable program or batch file.

我正在阅读 Core Java 第 1 卷(第 9 版).所以在这里它声明首先运行命令:

I'm reading Core Java volume 1 (9th edition). So here it stated to run firstly command:

javac -version

然后我得到了同样的错误.在 bin 目录中也没有 javac.exe,但我找到了 java.exe 并且它工作正常.那么 jar.exe 是否也更改为其他名称或其他名称?这本书是今年出版的,而且最新版本的文件名都不匹配,还是我在这里遗漏了什么?..

Then I got that same error. And in bin directory there were no javac.exe too, but I found java.exe and it worked. So does jar.exe is also changed to some another name or it somewhere else? It seems strange that this book is released this year and even names of files do not match in newest version or am I missing something here?..

附言我使用的是 Windows 7 64 位.

P.S. I'm using windows 7 64 bit.

使用命令:

回显%PATH%

返回:

%JAVA_HOME%\bin;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;%CommonPr
ogramFiles%\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Wind
ows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\I
ntel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Fi
les (x86)\Intel\OpenCL SDK\2.0\bin\x86;C:\Program Files (x86)\Intel\OpenCL SDK\2
.0\bin\x64;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program File
s\Common Files\Microsoft Shared\Windows Live;C:\Program Files\Intel\WiFi\bin\;C:
\Program Files\Common Files\Intel\WirelessCommon\

%JAVA_HOME% 设置为 C:\jdk1.7.0

推荐答案

我刚刚安装了同样的下载 在 Windows 7 64 位上,我有 C:\Program Files\Java\jdk1.7.0_40\bin\jar.exe 所以你可能也会这样做.

I just installed that same download on Windows 7 64-bit and I have C:\Program Files\Java\jdk1.7.0_40\bin\jar.exe so you probably do also.

我确实注意到您安装到了一个非标准位置,并且安装程序给了您两次机会来更改它的安装位置.

I did notice you installed to a non-standard location, and that the installer gives you two chances to change where it installs.

第一个安装程序窗口是安装 JDK.然后出现第二个窗口,安装 JRE.

The first installer window is installing the JDK. Then a second window comes up and that installs the JRE.

您可能在一个地方安装了 JDK,而在另一个地方安装了 JRE.JDK 将在其 bin 文件夹中包含 jar.exejavac.exejava.exe.JRE 将只有 java.exe .

You probably installed the JDK to one place and the JRE to another place. The JDK will have jar.exe, javac.exe, and java.exe inside its bin folder. The JRE will only have java.exe there.

因此,您应该找到安装 JDK 的位置.默认位置是 C:\Program Files\Java\jdk1.7.0_40 所以它在那里,除非你改变它.

Therefore you should find where you installed the JDK. The default place is C:\Program Files\Java\jdk1.7.0_40 so it is there unless you changed it.

这篇关于Java 开发工具包中的 jar.exe 在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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