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?
3 Answers
Run the following commands:
sudo dpkg --purge --force-depends ca-certificates-java
sudo apt-get install ca-certificates-javaWorked for me.
1I 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.
I have copied the file from original and it worked
sudo cp cacerts.original cacerts