Created
September 23, 2014 13:58
-
-
Save 4ndrew/f9dca61cedf0e8340b54 to your computer and use it in GitHub Desktop.
Extract JDK from Windows installer
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
#!/bin/sh | |
# usage example: prepareJdk.sh jdk-7u67-windows-x64.exe (result will be in jdk/) | |
# Requires: p7zip, unzip | |
JDK_EXE=$1 | |
7z x -ojdk "$JDK_EXE" | |
unzip jdk/tools.zip -d jdk/ | |
find jdk/ -type f \( -name "*.exe" -o -name "*.dll" \) -exec chmod u+rwx {} \; | |
rm jdk/tools.zip | |
find jdk/ -type f -name "*.pack" | while read eachFile; do | |
echo "Unpacking $eachFile ..."; | |
./jdk/bin/unpack200.exe $eachFile ${eachFile%.pack}.jar; | |
rm $eachFile; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment