Created
November 23, 2014 22:16
-
-
Save jrnewell/a74b4924147c7ea26e51 to your computer and use it in GitHub Desktop.
Extract JDK.exe into a portable folder (cygwin/windows)
This file contains 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/bash | |
if [[ $# -ne 1 ]]; then | |
echo "usage: $0 <jdk.exe>" | |
echo "result will be in ./jdk" | |
exit 1 | |
fi | |
JDK_EXE=$1 | |
cabextract "$JDK_EXE" -d jdk_extract | |
cd jdk_extract | |
unzip tools.zip -d tools/ | |
mv COPYRIGHT tools | |
mv src.zip tools | |
cd tools | |
find . -type f \( -name "*.exe" -o -name "*.dll" \) -exec chmod u+rwx {} \; | |
find . -type f -name "*.pack" | while read eachFile; do | |
echo "Unpacking $eachFile ..."; | |
./bin/unpack200.exe $eachFile ${eachFile%.pack}.jar; | |
rm $eachFile; | |
done | |
cd .. | |
mv tools ../jdk | |
cd .. | |
rm -rf jdk_extract | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment