1

I am developing a simple java swing application which can encrypt/decrypt using AES-256 on NetBeans.

In development, there is an issue of illegal key size, which I need to install JCE unlimited strength .jar file. Once I did that everything worked fine.

Until, I exported an executable jar file when the error came back again!

illegal key size.

What should I do ?

Environment

JAVA 1.8, JCE Installed, JAVA_HOME has been set, NetBeans IDE.

kiner_shah
  • 3,939
  • 7
  • 23
  • 37
Jongz Puangput
  • 5,527
  • 10
  • 58
  • 96

1 Answers1

0

For me both terminal and sh file execution will cause the exception while running in IDEA works fine.

After checking my Java folder,I found that there was folders naming jdk1.8.0_121 (whick contains 'jre') and jre1.8.0_131.And java -version indicated my java version was 1.8.0_131.

So I guess maybe my jre updated sometime while jdk remains the same.After update the new jre's lib/security following instructions.Then everything works fine.

I think the reason why editors like IDEA and terminals have different running behavior is: the former works through compiler(jdk) while the latter through runtime(jre).

XYz Amos
  • 1,403
  • 14
  • 17