How to fix Java on Debian Lenny

This post was previously about getting Amazon ec2 API tools working on Debian Lenny when seeing something like this:

user@computer:$ ec2-describe-instances
Unexpected error:
javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
at sun.security.ssl.Alerts.getSSLException(Alerts.java:208)
at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1611)

After number of comments it looked as a generic solution to java related problems so I’ve change the title.

Here is how to fix it Java on Lenny:

user@computer:$ apt-get install openjdk-6-jre
mkdir /tmp/java
cd /tmp/java
wget http://ftp.de.debian.org/debian/pool/main/c/ca-certificates-java/ca-certificates-java_20100412_all.deb
ar xf ca-certificates-java_20100412_all.deb
tar -zxvf data.tar.gz
cd /usr/lib/jvm/java-6-openjdk/jre/lib/security/
mv cacerts cacerts.PREVIOUS
cp /tmp/java/usr/share/ca-certificates-java/cacerts /usr/lib/jvm/java-6-openjdk/jre/lib/security/cacerts

If you get 404 when running wget go here and download latest package.

Share on TwitterShare on TumblrSubmit to StumbleUponSave on DeliciousDigg ThisSubmit to reddit
  • http://moon.net.au Brenda

    Thanks! this solved the problem I was getting trying to send SSL mail using JavaMail. I also had to install binutils on my system to get the ‘ar’ command.

    • http://www.krzywanski.net/ Artur

      Good to know is actually a generic solution for java problems.

  • http://www.incloud.de Steffen Müller

    Thanks very much, solved it for me, too.

  • http://www.smartterra.eu Falk Brockerhoff

    Thank you! This steps did the job.

  • http://chriskottom.com Chris Kottom

    Thanks for the write-up. It was just what I needed.

  • http://klokie.com/ Klokie

    Hey thanks for the tip! This helped me solve the problem of getting Hudson to work with SSL encrypted feeds. Cheers!

  • Steffen

    Thanks – you saved my day! Works also for ssl related trouble with javax.mail.

    • Anonymous

      Cool, just changed the title as it seems to be generic java solution for lenny.

  • Tommacca

    Thanks! Fixed my ssl worries with javax.mail too.

    Also had to install binutils to get the ar command

  • Ms

    thanks for you help

  • http://twitter.com/tomcoady Tom Coady

    Wow, perfect fix, many thanks :)

  • Daniel David

    Thank you very much!!! I’m working in a java webapp using javamial and I got a similar problem sending mails with a gmail account via smtp. It works perfect.

  • Christopher Mosher

    Worked for me! (Trying to download Android Eclipse plugin) Thanks!

  • Gerard

    fokin’ osom thanx dude

  • http://twitter.com/mcdorians mcdorians

    Thanks helped me a lot

  • http://twitter.com/zakladochnick paul

    Thanks, man. Let the force be with you!=)

  • http://twitter.com/zakladochnick paul

    Thanks, man! Let the force be with you!=)

  • Go

    thanks a lot very helpful…..