Java is a bit more picky about SSL authorities than, say, Chrome or Firefox. Fortunately adding a certificates to Java to accept it as secure is fairly straight forward:
sudo keytool -import -keystore /usr/lib/jvm/java-6-sun/jre/lib/security/cacerts -file cert.crt
Of course acquiring the certificate file can be a little tricky as it’s entirely dependant on your setup. Also /usr/lib/jvm/java-6-sun/jre/lib/security/cacerts is the default location for the keystore on Ubuntu, this may differ depending on your OS/distribution.