How to install unlimited strength JCE for Java 8 in OS X?

As of Java 8u152, unlimited strength can be enabled simply by setting crypto.policy=unlimited in the java.security file in

/Library/Java/JavaVirtualMachines/<jdk_version>/Contents/Home/jre/lib/security 

It's already in that file but commented out.

enter image description here

See http://www.oracle.com/technetwork/java/javase/8u152-relnotes-3850503.html#JDK-8157561


Java 8 Update 161

As pointed out in another answer and in Oracle's release notes for Java 8 Update 161, unlimited cryptography is enabled by default since Update 161 and you shouldn't have to do anything if using a fresh installation of this version or higher.

Java 8 Update 151

With Java 8 Update 151, Oracle included the same JCE mechanism into Java 8 that they already provided with Java 9. To enable JCE in Java 8 Update 151 or higher, just set the property

crypto.policy=unlimited

in $JAVA_HOME/jre/lib/security/java.security.

It's probably a good idea to remove the old policy JAR's if they were added earlier, as Oracle states in the release notes:

Because the old JCE jurisdiction files are left in /lib/security, they may not meet the latest security JAR signing standards, which were refreshed in 6u131, 7u121, 8u111, and later updates.

Older Versions

Answers suggesting to install the JCE files via Homebrew won't work anymore, as the casks were deleted from the Homebrew repository after release of the Java 8 Update 151. If using an older version of Java 8, you'll have to put the JCE-Policy-JAR manually as described in another answer.


Note: As of Java JDK version 8u161 unlimited cryptography is enabled by default

FOR MacOS user

If you are MacOS user, put the jars extracted from jce_policy-8.zip if your java version is 8.* use below path (to put jars under it)

/Library/Java/JavaVirtualMachines/**< jdk_version_of_your_pc >**/Contents/Home/jre/lib/security

Tags:

Java

Macos

Jce