Make your own JDK portable installation

If you have no administrator right but want to use JDK, you may make your own portable JDK as below:
  1. Download latest version of JDK from Oracle (for example jdk-7u7-windows-x64.exe)
  2. Save jdk_portable.bat to the same directory of your jdk exe.
  3. Edit the 7-zip location and JAVA_HOME in jdk_portable.bat as needed.
  4. Run jdk_portable.bat 
  5. When you need to use Java, remember to setup JAVA_HOME and PATH manually to point to your JDK dir and its BIN subdirectory.

REM jdk_portable.bat REM Instruction: download the JDK, and place this .BAT file in the same folder. Then run this .bat file. REM stantsui.blogspot.com REM v1.0 2017-02-15 SET SEVENZIP="C:\Program Files\7-Zip\7z.exe" SET JAVA_HOME=c:\util\JDK for %%i in (jdk-8*.exe) DO %SEVENZIP% x %%i -o.\JDK *.* -r extrac32 JDK\.rsrc\1033\JAVA_CAB10\111 JDK\.rsrc\1033\JAVA_CAB10\tools.zip %SEVENZIP% x JDK\.rsrc\1033\JAVA_CAB10\tools.zip -oJDK\.rsrc\1033\JAVA_CAB10\tools *.* -r cd JDK\.rsrc\1033\JAVA_CAB10\tools\ for /r %x in (*.pack) do .\bin\unpack200 -r "%x" "%~dx%~px%~nx.jar" XCOPY *.* %JAVA_HOME%\ /s /e

Reference: Based on the manual step by Igor@StackOverFlow

Comments

Popular Posts