IntelliJ IDEA shortcut in linux

After a lot of digging around, I finally came across this blog entry telling how to make a shortcut to IDEA work in linux. In short, change your shortcut to something like the following:

/bin/sh -c "export JDK_HOME=/usr/lib/jvm/java-6-sun && /opt/IntelliJIdea8/bin/"

Voila! Victory is mine!


keytool is Strict

Let’s say you are setting up a connection to an LDAP server and need to get your security bits in place. ┬áTo get the certificate chain from the server, you may do something like this:

openssl s_client -showcerts -connect > cert_chain.pem

Now with the output of that, you want to create or add to a keystore. That command looks like this:

keytool -import -storetype jks -keystore dir_example.jks -storepass dir-example -file cert_chain.pem -alias ldap-ca -noprompt

But, oh no! Java spits back,

keytool error: java.lang.Exception: Input not an X.509 certificate

Well, that sucks, but have no fear! The trick to clearing this up is quite easy. keytool is quite strict. The output from the openssl command above is far too verbose for keytool, so you’ll need to clean up any text outside of the —–BEGIN CERTIFICATE—– and —–END CERTIFICATE—– markers in the file.