Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java Security Class Couldn't be found

When launching my program the next error pops out

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

which means this class is missing although I've found this class manually, works via jar/ide but doesn't works prefectly via service.

Maybe I need to make a few modifications? but which? Thanks in advance

like image 741
Swine1973 Avatar asked Sep 26 '26 03:09

Swine1973


1 Answers

I don't know if this is relevant to your problem but I was experiencing the exact same behavior due to versions of the JCE Policy files I was using.

Using the proper Unlimited Strength Cryptography Extenstions solved this issue for me. I believe I might have accidentally installed the extensions for Java 7 as opposed to 6. (I was using Java 6 for compilation)

For a windows machine, they should be installed in the jre/lib/security folder of your installed JDK, for example: c:\program files\Java\jdk1.6.0_33\jre\lib\security

like image 144
Thedaego Avatar answered Sep 28 '26 15:09

Thedaego