How to properly set up Sun's JDK?

Posted by jurchiks on Ask Ubuntu See other posts from Ask Ubuntu or by jurchiks
Published on 2011-02-12T18:20:53Z Indexed on 2011/02/12 23:33 UTC
Read the original article Hit count: 284

Filed under:
|
|

I'm trying to manually install the Sun JDK package (I have my reasons, don't bother asking why). I've successfully extracted the .bin file into /usr/lib/jvm/jdk1.6.0_23, but the problem is the PATH variable.

I added this line to the /etc/environment file: JAVA_HOME="/usr/lib/jvm/jdk1.6.0_23" and added JAVA_HOME/bin to the PATH variable, BUT the OS still doesn't recognise the command java, says it's not installed and offers me gcj and openjdk.

There was another way by using java-package and converting the .bin to .deb installer, but unfortunately that package is not available on/for maverick, so I can't do it that way.

How can I make the PATH variable work and is there anything else required apart from the environment variables to make it all work?
When I try to use the update-java-alternatives -l command, it says the following:
awk: cannot open /usr/lib/jvm/*.jinfo (No such file or directory)
jdk1.6.0_23 /usr/lib/jvm/jdk1.6.0_23

What should be the name of the file and the contents of it?

© Ask Ubuntu or respective owner

Related posts about java

Related posts about environment-variables