Created
April 26, 2019 18:20
-
-
Save valtoni/8ebdf424b3578320d94d8e42c76bab7e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @echo off | |
| SETLOCAL | |
| if "%1%"=="" ( | |
| echo Please, fill JDK exe installer as first parameter | |
| exit /B | |
| ) | |
| set z7="C:\Program Files\7-Zip\7z.exe" | |
| REM Decompress executable installer | |
| REM echo "Uncompressing %1..." | |
| REM %z7% x %1 | |
| REM set CUR_DIR=%~dp0 | |
| REM set JDK_FILE=%1 | |
| REM FOR %%i IN ("%CUR_DIR%\%JDK_FILE%") DO ( | |
| REM set JDK_DIR=%%~ni | |
| REM ) | |
| REM Creating target jdk | |
| echo Creating %JDK_DIR% | |
| mkdir %JDK_DIR% | |
| REM Tools | |
| echo "Decompress tools..." | |
| %z7% e %JDK_FILE% .rsrc\1033\JAVA_CAB10\111 | |
| %z7% x 111 | |
| %z7% x tools.zip -o%JDK_DIR% | |
| del 111 | |
| del tools.zip | |
| REM JDK Source | |
| echo "Decompress jdk source..." | |
| %z7% e %JDK_FILE% .rsrc\1033\JAVA_CAB7\108 | |
| %z7% x 108 -o%JDK_DIR% | |
| del 108 | |
| REM Unpack packed files | |
| echo "Unpacking files..." | |
| for /r %%i in (*.pack) do ( | |
| %JDK_DIR%\bin\unpack200 -r "%%i" "%%~di%%~pi%%~ni.jar" | |
| ) | |
| echo Blessed! Your jdk is %JDK_DIR% |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment