AES Illegal Key Size error occuring only in command line but not in IDE
I require a higher 开发者_JS百科key size for AES (192-bit) and installed JCE as per instructions on the site.
The strange thing is, while running my program in Netbeans, the encryption and decryption works perfectly.
But if I compile and run from command line, it would throw "java.security.InvalidKeyException: Illegal key size"
Is there something else I need to add to the compile command? My compile command is just the regular one, which looks something like this javac -d . -cp . DC\src\dc\Main.java DC\src\share\AES.java
Most probably your IDE uses a JDK, the commandline uses the standard JRE. You must install JCE in both directories.
Maybe look up the active Java in the PATH and double check the JCE there.
Are you sure that your IDE is using the same JRE as your command line?
精彩评论