Since Oracle doesn’t provide JDK as portable ZIP for Windows, this tutorial will show how to convert JDK from EXE to ZIP.
If you’re looking for instructions to convert JDK 9, the process is a bit different than this one for Java 8 and prior versions, so please visit the following tutorial for Java 9:
Visit this link to download the appropriate JDK for your Windows (32 or 64 bits), accepting Oracle’s license agreement.
Create a directory to work with (by example: C:\JDK) and copy the downloaded JDK to that directory;
Next, run 7-Zip, selected your JDK copy and click on Extract (Extrair):
Leave the settings as their default on the new window that has opened, then hit OK:
Wait until the process complete, you will end with a folder with the same name as the JDK file. Go into that folder and you should have the following structure:
Open the prompt, go to the directory where the above content were extract and run the commands below, to extract once again the content we need:
cd C:\JDK\jdk-8u121-windows-x64\.rsrc\1033\JAVA_CAB10 extrac32 111
A file named tools.zip is going to show up inside this directory, extract its contents with 7-Zip to get a tools folder with the following contents:
On the prompt again, run the following commands to convert the .pack into .jar files to finalize the process:
cd C:\JDK\jdk-8u121-windows-x64\.rsrc\1033\JAVA_CAB10\tools\ for /r %x in (*.pack) do .\bin\unpack200 -r "%x" "%~dx%~px%~nx.jar"
You’re done, the content inside the tools folder is now your portable JDK.
If you also want to extract the src.zip of the JDK for e.g. using with your IDE, please refer to:
Hope it helps. Cya!
This guide will show you how to create a Python function decorator with a few…
This guide will show you how to fix the error Got permission denied while trying…
This guide will show you how to create a Python virtual environment on Intellij IDEA…
This tutorial will quickly show you how to to find and kill processes on Linux,…
This guide shows a possible solution for Python error Relocation R_X86_64_PC32 against symbol can not…
I condensed below a cheat sheet of Kubernetes useful commands. I will keep updating this…
View Comments
Thank you! :)
Thank you!!!
unpack200 is not available in jdk 1.4. Any suggestion on how to unpack the .pack files ?
Hi [~bgasparotto~],
I used this method to extract the jdk, but while compiling a class, it gives=
Picked up _JAVA_OPTIONS: -Djava.net.preferIPv4Stack=true.
And when I fire "java Class_Name", it gives this error=
Picked up _JAVA_OPTIONS: -Djava.net.preferIPv4Stack=true
Error: Could not find or load main class Class_Name
All environment variables are set correctly. What do I need to do to solve this issue?
Thanks!! It works fine!
TippTopp, many thanks for the easy instruction :-)
I'm glad it worked! =]
Thanks!
I'm glad it worked!
Nice tutorial.
Many thanks,
This is really useful one.
Thanks for the post.
Thanks a lot.