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 of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.