Last active
November 4, 2022 02:57
-
-
Save bmaupin/87631863d55e2accc05ca7759247f887 to your computer and use it in GitHub Desktop.
Install jce_policy-8.zip on RHEL/CentOS 6/7
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
# See here for JDK 7: https://gist.github.com/bmaupin/4396be4bb29c5ad440b6 | |
# See here for test to make sure this works: https://gist.github.com/evaryont/6786915 | |
if grep -q -i "release 6" /etc/*release; then | |
jce_primary_link_dir=/usr/lib/jvm/jre-1.8.0-oracle.x86_64/lib/security | |
elif grep -q -i "release 7" /etc/*release; then | |
jce_primary_link_dir=/usr/lib/jvm/jce-1.8.0-oracle | |
fi | |
wget \ | |
--no-cookies \ | |
--no-check-certificate \ | |
--header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" \ | |
-O jce_policy-8.zip \ | |
http://download.oracle.com/otn-pub/java/jce/8/jce_policy-8.zip | |
jar xvf jce_policy-8.zip | |
# Copy them to an alternate location and use update-alternatives so they don't | |
# get overwritten when Java is updated | |
mkdir -p /usr/lib/jvm-private/java-1.8.0-oracle.x86_64/jce/unrestricted | |
/bin/cp -f UnlimitedJCEPolicyJDK8/local_policy.jar /usr/lib/jvm-private/java-1.8.0-oracle.x86_64/jce/unrestricted | |
/bin/cp -f UnlimitedJCEPolicyJDK8/US_export_policy.jar /usr/lib/jvm-private/java-1.8.0-oracle.x86_64/jce/unrestricted | |
update-alternatives \ | |
--install \ | |
$jce_primary_link_dir/local_policy.jar \ | |
jce_1.8.0_oracle_local_policy.x86_64 \ | |
/usr/lib/jvm-private/java-1.8.0-oracle.x86_64/jce/unrestricted/local_policy.jar \ | |
900000 \ | |
--slave \ | |
$jce_primary_link_dir/US_export_policy.jar \ | |
jce_1.8.0_oracle_us_export_policy.x86_64 \ | |
/usr/lib/jvm-private/java-1.8.0-oracle.x86_64/jce/unrestricted/US_export_policy.jar | |
rm -rf UnlimitedJCEPolicyJDK8 jce_policy-8.zip |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment