Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is jar.exe in Java Development Kit? [closed]

Tags:

java

windows

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

Gives me this error:

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

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

javac -version

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?..

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

using command:

echo %PATH%

retuns:

%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% is set to C:\jdk1.7.0

like image 533
Andrius Avatar asked Sep 12 '13 16:09

Andrius


People also ask

Where is jar EXE located?

The executable file of this tool can be located under the JDK_HOME\bin directory (jar.exe on Windows), so make sure you include this path in the PATH environment variable in order to run this tool anywhere from the command line prompt.

How do I open a jar file with JDK?

Right-click on the JAR file. Go to “Open With Other Applications”. Select Show other applications. Select Open With OpenJDK Java X Runtime.

Where can I find tools jar in JDK?

Ant expects the tools. jar file to be in the %JAVA_HOME%/lib but tools. jar is distributed with the JDK.

What is jar EXE?

Description. The jar command is a general-purpose archiving and compression tool, based on ZIP and the ZLIB compression format. However, the jar command was designed mainly to package Java applets or applications into a single archive.


1 Answers

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.

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

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.

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.

like image 142
Kevin Panko Avatar answered Oct 12 '22 23:10

Kevin Panko