Secure random no generation in jdk for snap

Hello,
I’m using open jdk as a stage package for my tomcat snap. The webapp UI takes lots of time to start the server. This delay is due to secure random no generation .
How can I reduce the secure random no generation delay from the snapcraft.yaml file directly, so that I don’t need to do it manually.

Open the $JAVA_HOME/jre/lib/security/java.security file in a text editor.
Change the line:

securerandom.source=file:/dev/random

to read:

securerandom.source=file:/dev/urandom

How can I change this line from the snapcraft.yaml file.

You can do this with a scriptlet, probably:

parts:
    mypart:
        ... # the rest of your part
        install: |
            sed -i 's|securerandom\.source=file:/dev/random|securerandom.source=file:/dev/urandom|' $SNAPCRAFT_PART_INSTALL/path/to/java.security

Make sure the path is correct.

Thankyou!!
This helped.