Oracle Java Development Kit (JDK) 8u151 & 8u152+ now allows you to set a “crypto.policy Security property in the file” instead of separately downloading & installing the JCE extensions (which everyone seems to struggle with the first time, deployment issues, etc).

It’s much easier now. Here’s how you can do it per JVM (remember this is only on 8u151+)

# Name or location of file can be anything:
$ echo crypto.policy=unlimited > ~/
$ groovysh
groovy:000> println(javax.crypto.Cipher.getMaxAllowedKeyLength("AES"))

Or system wide:

edit $JAVA_HOME/jre/lib/security/



One downside of this approach though is that you will have to remember to do this each time you update your JDK.

JDK 8u152 release notes -

Blog Logo

Eric Helgeson



Agile Orbit

Agile Development and DevOps

Back to Overview