15

Is it possible to get Java in zip format? I don't want to install it by getting .exe file.

Is there any zip version of Java 1.8 so that I can download it and extract it and start using it in my Windows machine (64-bit processor)?

SharpC
  • 6,974
  • 4
  • 45
  • 40
user1346316
  • 264
  • 1
  • 3
  • 10

6 Answers6

27

You can extract the JDK folder from the Installation EXE.

Check this link for the steps. The post was for JDK 1.7 it will work for JDK 1.8 also

Do the following.

Steps

  1. Download JDK from Oracle
  2. Download and Install 7-zip from here
  3. Open installition exe using 7-Zip
  4. Extract the tools.zip
  5. Extract the content of tools.zip to a folder (e.g. c:\jdk).
  6. Open the extracted folder in cmd prompt.
  7. Execute for /r %x in (*.pack) do .\bin\unpack200 -r "%x" "%~dx%~px%~nx.jar" command
  8. Set JAVA_HOME to the jdk (e.g c:\jdk) folder.
  9. Add %JAVA_HOME%/bin to the PATH env variable.

Testing

Run the following command to check the installation, it will print the version of JDK.

c:> javac -version
javac 1.7.0_51

NOTE: Tested with JDK 1.7 and 1.8

Update 1

Edited the answer to add the steps in the answer itself instead of the link to a blog post.

Update 2

For 64-Bit please check unpack-jdk-x64.bat by grabantot

seenukarthi
  • 8,241
  • 10
  • 47
  • 68
  • 5
    Be mindful that it only works with the 32-bit version. The x64 installer has completely different content. – Eugene A Aug 17 '16 at 09:36
  • @EugeneA I have tested this in Windows 64 bit with 64 bit JDK installer and it is working. – seenukarthi Aug 18 '16 at 08:35
  • 2
    Interesting, I just downloaded jdk-8u102-windows-x64.exe directly from the Oracle's website. The contents are: .rsrc [Dir] .data .pdata .rdata .reloc .text CERTIFICATE It's just as described in the 32-bit version. – Eugene A Aug 18 '16 at 09:34
  • @EugeneA Yes you are correct there is difference in 8u101 and 8u102 – seenukarthi Aug 18 '16 at 09:59
  • 2
    Here is [unpack-jdk-x64.bat](https://gist.github.com/grabantot/402a4acf63f81ba754b26e2dce1b16a3#file-unpack-jdk-x64-bat) to unpack 64 bit jdk. Don't forget to set 7z location at the top of the file. JDK will be unpacked to a folder named jdk, all temp files will be removed. – grabantot Apr 23 '17 at 15:36
4

I was looking for a solution to this as well. I'm not sure why the OP wanted to do this. I'm just trying to get a newer version of java for new development while not interfering with an older Java install which a legacy application requires (I'd like to update the legacy app, but it's not an option, now)

I think the hack I am going to try is this:

  1. Install 1.8
  2. Take a copy of the install folder
  3. Uninstall 1.8
  4. Reinstall / Repair 1.7
  5. restore the copy of 1.

I'm sure if I had a better understanding of what the install is doing, this would not be necessary.

Darrel Lee
  • 2,372
  • 22
  • 22
  • On Windows 10 you can run a built in sandbox, install there and copy the install folder. default is `C:\Program Files (x86)\Java` – Arye P. Feb 18 '23 at 16:19
2

I had a spare virtual machine hanging around (if not you could build one or maybe even download one) so I:

  • installed the Oracle JDK in the guest
  • copied the jdk folder from the guest to the host
  • added a JAVA_HOME environment variable.

The operating systems obviously have to be close (not sure how close, I used Windows Server 2008 64 bit guest on a Windows 10 64 bit host and it seemed to work).

Was a quick fix for me as I didn't want a full install and wanted to remove it afterwards.

SharpC
  • 6,974
  • 4
  • 45
  • 40
0

If you do not have permission to unzip zip file then you cannot install java . As java does not need installation for running . You just need to give path of java.exe where it is located .

In Windows it is located in C:\Program Files\Java\jdk1.8.0_05\bin For a solution you can run installer on any machine that you have permission and just copy and paste the folder of java to anywhere in your system (Machine where you have administrative rights problem) . and just set the path as by opening command prompt as set path="C:\Program Files\Java\jdk1.8.0_05\bin" java will be working as you want

SarthAk
  • 1,628
  • 3
  • 19
  • 24
0

The following worked for me (I had JDK 1.8 installed and needed the 32 bit version as well):

  • Verify the current version with java -version
  • Assuming a different version (minor or major is being installed), download the relevant JDK installable from Oracle and run it. In the first dialog, specify a different folder than the default location (might work with the default one as well), then select Next. It will extract the files there in this folder, then it will asl for the folder where the JRE is to be installed. Simply close the installer, now you should have just the JDK in the specified folder.
  • Rerun java -version, it should give you the same version as earlier.
  • Worst case, if it shows the newer version, go to your system path (Right click My Computer (or This PC) -> Properties -> Advanced system settings -> Advanced tab -> click on Environment variables button) and remove the Oracle javapath entry (From the Path variable in the bottom part of the window). The add the older java version's bin folder to the path variable in the beginning.
Deepak
  • 3,648
  • 1
  • 22
  • 17
0

for /r %x in (*.pack) do .\bin\unpack200 -r "%x" "%~dx%~px%~nx.jar"

Is this working for linux shell scripting , I got syntax error for the above.

anonymous
  • 13
  • 3
  • 1
    As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community May 09 '22 at 18:42