Here is a blog post I made that shows a detailed example of installing Java and setting the default with alternatives. Note: sometimes people install Java JDK's into '/usr/lib/jvm', and as you can see in the output on my blog post, the system came with default JVMs in this location, but personally I don't recommend that for a JDK. Maybe I would choose '/usr/lib/jvm' if it was a JRE I was installing. If you wanted an alternative location for JDKs and JREs, I would choose either:
1. /usr/java/ 2. /opt/java/