How to install java jdk on Ubuntu? here i provide few steps to demonstrate how it’s work.
Installation Setup
1 ) Issue following command to find out current jdk version in apt-get
apt-cache search jdk
2 ) Install java JDK and JRE with apt-get install
apt-get install sun-java6-jdk sun-java6-jre
3 ) Ubuntu will auto download necessary file from web for installation.
Do you want to continue [Y/n]? y Get:1 http://my.archive.ubuntu.com hardy/main java-common 0.28ubuntu3 [78.2kB] Get:2 http://my.archive.ubuntu.com hardy/multiverse sun-java6-jre 6-06-0ubuntu1 [6334kB] Get:3 http://my.archive.ubuntu.com hardy/main odbcinst1debian1 2.2.11-16build1 [66.2kB] Get:4 http://my.archive.ubuntu.com hardy/main unixodbc 2.2.11-16build1 [289kB] Get:5 http://my.archive.ubuntu.com hardy/multiverse sun-java6-bin 6-06-0ubuntu1 [27.3MB] Get:6 http://my.archive.ubuntu.com hardy/multiverse sun-java6-jdk 6-06-0ubuntu1 [9625kB] 85% [6 sun-java6-jdk 3208002/9625kB 33%]
4) After installation done, jdk and jre will install at /usr/lib/jvm/java-6-sun-1.6.0.06
5) Ubuntu help to create a java symbolic link and put in /usr/bin for shortcut access
4 ) type java -version, DONE !!
Post-Installation Setup
Set JAVA_HOME into environment variable
Copy following statement and append to /etc/profile or .bashrc file, make system set JAVA_HOME into system environment variable.
export JAVA_HOME="/usr/lib/jvm/java-6-sun-1.6.0.06;"
P.S Please visit How to install JDK on Fedora Core, if you want to know how to install java jdk manually.



Hi,
A video from YouTube on how to install Java 6 on Ubuntu here.
Sunil.
Hi,this is my problem? can any one help me
E:could not get lock/var/lib/dpkg/lock-open(11 Resourse temporarily unavailable)
E:unable to lock the administration direction(/var/lib/dpkg/), is another process using it
[...] Please visit How to install JDK on Ubuntu, if you want to know how to install java jdk with [...]
Hello guys nice tips
Does anyone knoes about how to make update to be done automatically?In other words , the PATH to set itself.
Or i have to do it manually in every update?
hi this is my problem,can anyone help me?
E: Could not open lock file /var/lib/dpkg/lock – open (13 Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
I’m root, of course
Ya, you need permission to install the jdk in Ubuntu.
[...] Via | ProgrammerLife [...]
Thanks for easy steps to installing jdk on ubuntu
he!!
the following error is occuring:
E: Could not open lock file /var/lib/dpkg/lock – open (13 Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
could you help me??
ya, im root. Please talk to your Unix administrator to get the necessary permission
if u get the correct solution .pls mail me
you do not have permission to do it, check with your administrator
I have the last JDK
http://www.elleonplateadodeojosrojos.es/blog/java_development_kit-jdk/
er…sorry i have no idea about it… and i cant simulate the problem here
Here is my suggestion
1) apt-get find to find another jdk version (1.5 may be)
http://www.mkyong.com/linux/find-a-package-with-apt-command-ubuntu/
2) Download JDK from sun and install manually < -- 100% working method
http://www.mkyong.com/java/how-to-install-java-jdk-on-fedora-core-linux/
Hi,
I got following message when trying the command:
apt-get install sun-java6-jdk
–>
Configuring sun-java6-bin
Operating System Distributor License for Java v1.1(DLJ)
and it’s stuck there. I cannot enter anything.
Any idea? Thanks.
try pressing tab. and then when ok is selected, press enter
The first line should have been
1) <your-mirror-site>/ubuntu/pool/multiverse/s/sun-java6/
Java 6 Update 11 on e.g. 8.04?
1) /ubuntu/pool/multiverse/s/sun-java6/
2) download all *6-11-0ubuntu1_i386.deb and *6-11-0ubuntu1_all.deb
6-11-0ubuntu1_i386.deb packages
3) sudo dpkg -i *.deb
Thanks lonny27
better set your java alternative to be sure you are using the correct java/jdk version:
>update-java-alternatives –list
java-1.5.0-sun 53 /usr/lib/jvm/java-1.5.0-sun
java-6-sun 63 /usr/lib/jvm/java-6-sun
>sudo update-java-alternatives –set java-6-sun
and don’t link java_home to a minor version because that will break after an update, better link to the symbolic link to the latest version
>export JAVA_HOME=”/usr/lib/jvm/java-6-sun”
Thanks soma, your tips is useful !
hi akumum, Vatar
nice tips, thanks for extra info
There is also
sudo apt-get install openjdk-6-jdk
in ubuntu its much easier, just do:
sudo apt-get install ubuntu-restricted-extrasthis install everything that is needed like media codecs for mp3s and the such, as well as java.