在JVM环境中解决:

打开$JAVA_PATH/jre/lib/security/java.security这个文件,找到下面的内容:

securerandom.source=file:/dev/random

替换成

securerandom.source=file:/dev/./urandom

注意改动了两个地方:
1.在路径中加了一个 “​​​.​​​”
2.​​​random​​​变成​​urandom​

具体参见tomcat启动慢, Creation of SecureRandom instance for session ID generation using [SHA1PRNG]took [xx] mil