<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic java.security.ProviderException: setSeed() failed in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/java-security-providerexception-setseed-failed/m-p/3578423#M831705</link>
    <description>Hi i have written following code, and compiled using 'javac testc.java'&lt;BR /&gt;It got compiled succefully.&lt;BR /&gt;But when we are trying to run that its giving Error as shown after my program.&lt;BR /&gt;Please note:&lt;BR /&gt;when i run it using command 'java -cp . testc'&lt;BR /&gt;its giving problem, But if i am executing it using 'java -Djava.security.egd=/dev/random -cp . testc' it Succefully executing.&lt;BR /&gt;=======================================&lt;BR /&gt;import java.io.*;&lt;BR /&gt;import java.util.Properties;&lt;BR /&gt;import java.util.Vector;&lt;BR /&gt;import java.net.*;&lt;BR /&gt;import java.security.SecureRandom;&lt;BR /&gt;&lt;BR /&gt;public class testc {&lt;BR /&gt;&lt;BR /&gt;public static void main(String args[]){&lt;BR /&gt;&lt;BR /&gt;    SecureRandom secureRandom = new SecureRandom();&lt;BR /&gt;        secureRandom.setSeed(System.currentTimeMillis());&lt;BR /&gt;System.out.println("Executed Successfully");&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;==============================&lt;BR /&gt;Error on Execution::&lt;BR /&gt;==============================&lt;BR /&gt;jeshp01 &amp;gt;java -cp . testc                                &lt;BR /&gt;Exception in thread "main" java.security.ProviderException: setSeed() failed&lt;BR /&gt;        at sun.security.provider.NativePRNG$RandomIO.implSetSeed(NativePRNG.java:223)&lt;BR /&gt;        at sun.security.provider.NativePRNG$RandomIO.access$100(NativePRNG.java:108)&lt;BR /&gt;        at sun.security.provider.NativePRNG.engineSetSeed(NativePRNG.java:92)&lt;BR /&gt;        at java.security.SecureRandom.setSeed(SecureRandom.java:400)&lt;BR /&gt;        at testc.main(testc.java:12)&lt;BR /&gt;Caused by: java.io.IOException: No such device&lt;BR /&gt;        at java.io.FileOutputStream.writeBytes(Native Method)&lt;BR /&gt;        at java.io.FileOutputStream.write(FileOutputStream.java:247)&lt;BR /&gt;        at sun.security.provider.NativePRNG$RandomIO.implSetSeed(NativePRNG.java:221)&lt;BR /&gt;        ... 4 more&lt;BR /&gt;===========================================&lt;BR /&gt;&lt;BR /&gt;Now my question is how i can run this program without using option &lt;BR /&gt;"-Djava.security.egd=/dev/random" ????????  Is there any way so that we can change in code to make it work without using above option.</description>
    <pubDate>Fri, 08 Jul 2005 06:19:52 GMT</pubDate>
    <dc:creator>Moiz Khambaty</dc:creator>
    <dc:date>2005-07-08T06:19:52Z</dc:date>
    <item>
      <title>java.security.ProviderException: setSeed() failed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/java-security-providerexception-setseed-failed/m-p/3578423#M831705</link>
      <description>Hi i have written following code, and compiled using 'javac testc.java'&lt;BR /&gt;It got compiled succefully.&lt;BR /&gt;But when we are trying to run that its giving Error as shown after my program.&lt;BR /&gt;Please note:&lt;BR /&gt;when i run it using command 'java -cp . testc'&lt;BR /&gt;its giving problem, But if i am executing it using 'java -Djava.security.egd=/dev/random -cp . testc' it Succefully executing.&lt;BR /&gt;=======================================&lt;BR /&gt;import java.io.*;&lt;BR /&gt;import java.util.Properties;&lt;BR /&gt;import java.util.Vector;&lt;BR /&gt;import java.net.*;&lt;BR /&gt;import java.security.SecureRandom;&lt;BR /&gt;&lt;BR /&gt;public class testc {&lt;BR /&gt;&lt;BR /&gt;public static void main(String args[]){&lt;BR /&gt;&lt;BR /&gt;    SecureRandom secureRandom = new SecureRandom();&lt;BR /&gt;        secureRandom.setSeed(System.currentTimeMillis());&lt;BR /&gt;System.out.println("Executed Successfully");&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;==============================&lt;BR /&gt;Error on Execution::&lt;BR /&gt;==============================&lt;BR /&gt;jeshp01 &amp;gt;java -cp . testc                                &lt;BR /&gt;Exception in thread "main" java.security.ProviderException: setSeed() failed&lt;BR /&gt;        at sun.security.provider.NativePRNG$RandomIO.implSetSeed(NativePRNG.java:223)&lt;BR /&gt;        at sun.security.provider.NativePRNG$RandomIO.access$100(NativePRNG.java:108)&lt;BR /&gt;        at sun.security.provider.NativePRNG.engineSetSeed(NativePRNG.java:92)&lt;BR /&gt;        at java.security.SecureRandom.setSeed(SecureRandom.java:400)&lt;BR /&gt;        at testc.main(testc.java:12)&lt;BR /&gt;Caused by: java.io.IOException: No such device&lt;BR /&gt;        at java.io.FileOutputStream.writeBytes(Native Method)&lt;BR /&gt;        at java.io.FileOutputStream.write(FileOutputStream.java:247)&lt;BR /&gt;        at sun.security.provider.NativePRNG$RandomIO.implSetSeed(NativePRNG.java:221)&lt;BR /&gt;        ... 4 more&lt;BR /&gt;===========================================&lt;BR /&gt;&lt;BR /&gt;Now my question is how i can run this program without using option &lt;BR /&gt;"-Djava.security.egd=/dev/random" ????????  Is there any way so that we can change in code to make it work without using above option.</description>
      <pubDate>Fri, 08 Jul 2005 06:19:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/java-security-providerexception-setseed-failed/m-p/3578423#M831705</guid>
      <dc:creator>Moiz Khambaty</dc:creator>
      <dc:date>2005-07-08T06:19:52Z</dc:date>
    </item>
  </channel>
</rss>

