---
title: "Tomcat启动时Creation of SecureRandom instance for session ID很慢"
author: "wkm"
date: "2018-09-26T12:00:46Z"
tags: []
categories: ["开源软件"]
slug: "tomcat-creation-of-securerandom-instance-for-session-id"
draft: false
lastmod: "2024-10-10T16:57:31Z"
id: 2431349
url: "https://wkm.iteye.com/blog/2431349"
---

# Tomcat启动时Creation of SecureRandom instance for session ID很慢

解决方案有两种：

1、修改java.security文件

     文件位置:$JAVA\_HOME/jre/lib/security/java.security

     打开并找到以下内容：

         securerandom.source=file:/dev/random

     修改为：

         securerandom.source=file:/dev/urandom

 

2、添加参数java.security.egd=file:/dev/./urandom

     在启动Tomcat时添加启动参数-Djava.security.egd=file:/dev/urandom

     可在catalina.sh文件中添加

 

第一种已测试，第二种修改未做测试

（已迁移）