Setting -Djava.security.egd=file:/dev/urandom does not take effective in Java

Solution Verified - Updated -

Issue

My java application using java.security.SecureRandom hangs like https://access.redhat.com/solutions/34626. To resolve the issue, I tried adding the system property -Djava.security.egd=file:/dev/urandom to use /dev/urandom instead of /dev/random. But it looks the setting does not take effective in Java 6 and 7.

Environment

  • Java application using java.security.SecureRandom
  • OpenJDK
    • 6
    • 7
  • Oracle JDBC Driver

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In