Deleting cacerts file in Java

Solution Unverified - Updated -

Issue

  • After removing the cacerts file for security reasons, we are getting a FileNotFound exception
  • Getting error after deleting cacerts or later

    java.io.FileNotFoundException: /opt/jdk1.7.0_181/jre/lib/security/cacerts (No such file or directory)
        at java.io.FileInputStream.open(Native Method)
        at java.io.FileInputStream.<init>(FileInputStream.java:146)
        at sun.security.util.AnchorCertificates$1.run(AnchorCertificates.java:60)
            ...
    

Environment

  • Java 8u121 or later
  • Java 7u131 or later

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content