I've been trying to setup a java dev environment with no luck. I installed openjdk-8-jdk but I keep getting java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty (when running android's sdkmanager). I've tried updating the cacerts file with sudo update-ca-certificates --fresh but no luck. /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/security/cacerts does indeed point to /etc/ssl/certs/java/cacerts but java still can't find the certificates?

  • So far I have tried to update the Cacerts and no luck either, sorry I can't help. – Vethor May 5 '18 at 20:41

Run the following commands:

sudo dpkg --purge --force-depends ca-certificates-java

sudo apt-get install ca-certificates-java

Worked for me.

|improve this answer|||||
  • Had tried a "forced" update before - which disn't work. This, much to my joyful surprise, did! – Klaws Feb 9 at 10:52

I had the exact same issue, I linked the old ca certificates from java8 to new openjdk11. Go to the directory -

cd $(/usr/libexec/java_home -v 11)/lib/security
sudo ln -fsh /Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home/jre/lib/security/cacerts 

What I see is, people install the older version of java, link the cacerts.

|improve this answer|||||

I have copied the file from original and it worked

sudo cp cacerts.original cacerts
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.