找不到任何支持AES / CBC / PKCS5Padding的提供商

时间:2016-08-01 03:29:09

标签: maven intellij-idea

我使用IDEA开发我的代码,在IDEA环境中,代码运行良好,但是当我使用mvn clean install来构建项目,并使用此脚本运行projet时

#!/bin/bash


source ~/.bashrc

JAVA_OPTS="$JAVA_OPTS -Drun_dir=$MY_ROOT"
JAVA_OPTS="$JAVA_OPTS -server -Xss256k -Xms1g -Xmx1g"
JAVA_OPTS="$JAVA_OPTS -XX:-OmitStackTraceInFastThrow"
JAVA_OPTS="$JAVA_OPTS -XX:PermSize=128m -XX:MaxPermSize=128m"
JAVA_OPTS="$JAVA_OPTS -XX:+DisableExplicitGC -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC -XX:+UseParNewGC"
JAVA_OPTS="$JAVA_OPTS -XX:CMSFullGCsBeforeCompaction=4 -XX:CMSInitiatingOccupancyFraction=80 -XX:MaxTenuringThreshold=15"
JAVA_OPTS="$JAVA_OPTS -Dclient.enczoding.override=UTF-8 -Dfile.encoding=UTF-8 -Duser.language=zh -Duser.region=CN"
JAVA_OPTS="$JAVA_OPTS -Djava.ext.dirs=./lib -Djava.library.path=./lib -cp ./resources"

java $JAVA_OPTS Main

它出现了错误

Cannot find any provider supporting AES/CBC/PKCS5Padding

jdk是同一版本,任何人都可以提供帮助吗?

1 个答案:

答案 0 :(得分:0)

感谢dave_thompson_085 , 将脚本更改为

source ~/.bashrc

CLASSPATH=$CLASSPATH:$JAVA_HOME/lib/tools.jar

for jar in `ls ./lib`
do
   CLASSPATH=$CLASSPATH:./lib/$jar;
done
CLASSPATH=$CLASSPATH:./resources


JAVA_OPTS="$JAVA_OPTS -server -Xss256k -Xms1g -Xmx1g"
JAVA_OPTS="$JAVA_OPTS -XX:-OmitStackTraceInFastThrow"
JAVA_OPTS="$JAVA_OPTS -XX:PermSize=128m -XX:MaxPermSize=128m"
JAVA_OPTS="$JAVA_OPTS -XX:+DisableExplicitGC -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC -XX:+UseParNewGC"
JAVA_OPTS="$JAVA_OPTS -XX:CMSFullGCsBeforeCompaction=4 -XX:CMSInitiatingOccupancyFraction=80 -XX:MaxTenuringThreshold=15"
JAVA_OPTS="$JAVA_OPTS -Dclient.enczoding.override=UTF-8 -Dfile.encoding=UTF-8"

java $JAVA_OPTS  -classpath $CLASSPATH Main