Kerberos: How to solve “Failed on local exception: java.io.IOException”

If you are running Java applications that use Kerberos (like Spark) you might get this error message:

It happens when you don’t have the Java Cryptography Extension (JCE) installed. To solve it, first you need to know where the Java’s home is, and then run

If the error persists and/or you’re running it inside a Docker container, see this thread about Kerberos and FQDN issue.