java.lang.NoClassDefFoundError: Could not initialize class javax.crypto.JceSecurityManager

java.lang.NoClassDefFoundError: Could not initialize class javax.crypto.JceSecurityManager
    javax.crypto.Cipher.getConfiguredPermission(Cipher.java:2543)
    javax.crypto.Cipher.getMaxAllowedKeyLength(Cipher.java:2567)
    sun.security.ssl.CipherSuite$BulkCipher.isAvailable(CipherSuite.java:548)
    sun.security.ssl.CipherSuite$BulkCipher.isAvailable(CipherSuite.java:527)
    sun.security.ssl.CipherSuite.isAvailable(CipherSuite.java:194)
    sun.security.ssl.SSLContextImpl.getApplicableCipherSuiteList(SSLContextImpl.java:350)
    sun.security.ssl.SSLContextImpl.getDefaultCipherSuiteList(SSLContextImpl.java:308)
    sun.security.ssl.SSLSocketImpl.init(SSLSocketImpl.java:607)
    sun.security.ssl.SSLSocketImpl.<init>(SSLSocketImpl.java:549)
    sun.security.ssl.SSLSocketFactoryImpl.createSocket(SSLSocketFactoryImpl.java:110)
    com.sun.mail.util.SocketFetcher.startTLS(SocketFetcher.java:428)
    com.sun.mail.smtp.SMTPTransport.startTLS(SMTPTransport.java:1647)
    com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:534)
    javax.mail.Service.connect(Service.java:291)
    org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailSenderImpl.java:389)
    org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:340)
    org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:355)
    org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:344)
    net.codejava.spring.SendEmailAttachController.sendEmail(SendEmailAttachController.java:41)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    java.lang.reflect.Method.invoke(Method.java:483)
    org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176)
    org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:440)
    org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:428)
    org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:919)
    org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:851)
    org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:953)
    org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:855)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
    org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:829)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

Confluence can not start or user can not log in due to javax.crypto , occurred getting message body from Velocity: java.lang.​NoClassDefFoundError: Could not initialize class javax.crypto.SunJCE_b  Error:Could not initialize class javax.crypto.JceSecurity [closed] Ask Question Asked 5 years, 5 months ago. Active 5 years, 5 months ago. Viewed 11k times


If you are using Java 8 Update 151 (8u151) or later, also check this:

New Features New Security property to control crypto policy

This release introduces a new feature whereby the JCE jurisdiction policy files used by the JDK can be controlled via a new Security property. In older releases, JCE jurisdiction files had to be downloaded and installed separately to allow unlimited cryptography to be used by the JDK. The download and install steps are no longer necessary. To enable unlimited cryptography, one can use the new crypto.policy Security property. If the new Security property (crypto.policy) is set in the java.security file, or has been set dynamically by using the Security.setProperty() call before the JCE framework has been initialized, that setting will be honored. By default, the property will be undefined. If the property is undefined and the legacy JCE jurisdiction files don't exist in the legacy lib/security directory, then the default cryptographic level will remain at 'limited'. To configure the JDK to use unlimited cryptography, set the crypto.policy to a value of 'unlimited'. See the notes in the java.security file shipping with this release for more information.

Note: On Solaris, it's recommended that you remove the old SVR4 packages before installing the new JDK updates. If an SVR4 based upgrade (without uninstalling the old packages) is being done on a JDK release earlier than 6u131, 7u121, 8u111, then you should set the new crypto.policy Security property in the java.security file.

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. An exception similar to the following might be seen if the old files are used:

JIRA throws exception 'Could not initialize class javax.crypto , It seems that with recent JVM, we get: java.lang.SecurityException: access denied to: ("java.security.SecurityPermission" "getProperty.crypto.policy") at  Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information. Learn more java.lang.NoClassDefFoundError: Could not initialize class javax.crypto.JceSecurityManager


This happened to me when I was trying to connect to a DB with IntelliJ 14.

I had played around with my jre\lib\security\local_policy.jar and jre\lib\security\US_export_policy.jar files

I fixed this by:

  1. Installing a new JDK
  2. Pointing IntelliJ to use this new JDK
  3. Setting JAVA_HOME to this new JDK
  4. Restart IntelliJ

Bug #12448: Failed generation with "Could not initialize class javax , java.lang.NoClassDefFoundError: Could not initialize class javax.crypto.​SunJCE_b. Get link; Facebook; Twitter; Pinterest; Email; Other Apps. [jvm-packages] java.lang.NoClassDefFoundError: Could not initialize class ml.dmlc.xgboost4j.java.XGBoostJNI #2578 edumucelli opened this issue Aug 4, 2017 · 5 comments Comments


Try the following steps:

  1. Uninstall all old versions of Java, and keep only one version(preferably latest version of JDK)
  2. If manual entries of old java environment path is set, remove them eg) JAVA_HOME, PATH
  3. Point the IDE (eg. Eclipse) to the latest version of JDK
  4. Revert to original jar files in the JDK/JRE if modified earlier by manual steps
  5. Click 'Check of update' from java installation on the system/PC

java.lang.NoClassDefFoundError: Could not initialize class , The database setup step of bin/setup from a clean rvm gemset and jruby 1.7.5 throws the following exception: D, [2014-01-12T11:43:47.120000  Re: java.lang.NoClassDefFoundError: Could not initialize class 807591 Mar 28, 2008 8:26 PM ( in response to 807591 ) I remember something about a system property called java.awt.headless.


I hit this when trying to run Maven in the library/openjdk:9 Docker container. I resolved it the same way as other commenters here, by getting a Java 9 JDK from Oracle at https://jdk9.java.net/download/ and setting JAVA_HOME. It seems that these two jar files (mentioned in other answers) aren't present in the Docker image.

java.lang.ClassNotFoundException: javax/crypto/JceSecurity · Issue , java.lang.NoClassDefFoundErrorCould not initialize class javax.crypto.​JceSecurityManager. This crash was crawled from Stack Overflow 4 years ago  You won’t have to wait too long for a reply, but why not learn more about the Community while you’re here. Not the right discussion for you? Find out what else our Community has to say about API Support .


EGit / JGit » Fail to pull/push"Could not , Engage with our Red Hat Product Security team, access security updates, and ensure your environments are not exposed to any known security vulnerabilities. Product Security Center Security Updates


Hudson » Unable to show latest ,