SunTlsRsaPremasterSecret KeyGenerator not available

前端 未结 8 1739
逝去的感伤
逝去的感伤 2020-11-30 14:00

I encountered an error when my application tries to load a RSA Algorithm provider class from JAVA. The exception stack is as follow:

javax.jms.JMSException:          


        
相关标签:
8条回答
  • 2020-11-30 14:11

    I've had the same problem after upgrading to new Java version on Mac. My (maven) project ran OK from command line but got the "SunTlsRsaPremasterSecret" error in Eclipse.

    The solution was to remove Installed JREs in Eclipse configuration and add them again (using the "Search..." button).

    0 讨论(0)
  • 2020-11-30 14:13

    Probable solution: Check if jdk path is set till C:\Program Files\Java\jdk1.8.0_171 but not including bin

    0 讨论(0)
  • 2020-11-30 14:19

    I also had this issue, noticed that the problem was in my Eclipse configuration.

    Window > Preferences > Java > Installed JREs > jdk8_64bit > Edit...
    

    The path of my sunjce_provider.jar was pointing to jdk8_64bit\lib\ext\sunjce.provider.jar. It should point to the JRE's equivalent in jdk8_64bit\jre\lib\ext\sunjce.provider.jar.

    0 讨论(0)
  • 2020-11-30 14:21

    Had to spend almost a day on this while trying to use JavaMail in Eclipse Luna. Tried all approaches suggested in various forums, but no luck.

    Digged into the complete flow and found the exception arising due to Class is on BootClassPath

    from KeyAgreement.getInstance()->JceSecurity.canUseProvider()->JceSecurity.getVerificationResult()->JarVerifier.verify()

    void verify() throws JarException, IOException { if (jarURL == null) { throw new JarException("Class is on the bootclasspath"); }.......

    I removed sunjce_provider jar from \ext\ folder and can send mail now. This might not be right but atleast a quick workaround.

    Refer Eclipse bug.

    0 讨论(0)
  • 2020-11-30 14:24

    It happened to me while launching the tomcat server from eclipse. I solved it by changing the configuration in Windows -> Preferences -> Java -> Installed JREs -> Edit. I had to update all the JRE system libraries with the corresponding jars from the folders in:

    • %JAVA_HOME%/jre/lib/ext
    • %JAVA_HOME%/jre/lib/

    It seems that after the last update I have changed the JRE_Home but forgot those libraries.

    0 讨论(0)
  • 2020-11-30 14:26

    I know, I am joining late here. But for me, this error came suddenly as soon as I changed the Preference -> Java -> Installed JREs -> Execution Environments as JavaSE-1.8 to jdk1.8 path. But it should be jre1.8 path.

    I don't know why is it happening now. But It sorted the problem.

    0 讨论(0)
提交回复
热议问题