It recently happened to me that I was stuck at work on a Windows installation without access to admin privileges. While I could use a bunch of portable apps I could not find a portable JDK. To get a portable JDK without admin privileges in Windows you have to follow three simple steps.
Listen to some relaxing music while reading my blog post
Download the JDK from Oracle (e.g. JDK 8 8u111).
If you want to use the x86 version simply open the .exe file with 7-Zip. It contains a single file
tools.zip, which contains all the files we need.
For x64 the tools.zip can be found in
Extract the tools.zip to the desired JDK directory (e.g. “D:\JavaJDK\”).
Now we need to unpack a few files packed with pack200. We do that by executing this script in a console window inside the root of the JDK directory (e.g. “D:\JavaJDK\”):
for /R %f in (.\*.pack) do @"%cd%\bin\unpack200" -r -v -l "" "%f" "%~pf%~nf.jar"
Congrats you now have a working, portable JDK!