Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
How to install the Sun Java JDK?

Hi all,recently i installed ubuntu in virual box inside the a windows os,but i'm unable to install the jdk in that ubuntu,can any one help me out?

share|improve this question

migrated from Feb 22 '11 at 15:41

This question came from our site for professional and enthusiast programmers.

marked as duplicate by Jorge Castro, Marco Ceppi Feb 22 '11 at 15:47

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question. and and… and net is full of such web page search on it. – Harry Joy Feb 22 '11 at 10:04
have you tried The stack exchange site for questions like this? – KitsuneYMG Feb 22 '11 at 10:09
sudo apt-get install openjdk-6-jdk
share|improve this answer
although this will install the open-jdk version which might not be what you want. – Joel Feb 22 '11 at 10:02

type java and follow the instructions

share|improve this answer
actually, I would type (ie, I typed) javac to make sure I got the JDK, not the JRE – Rolf Rander Feb 22 '11 at 10:08
indeed, but I'm hoping this is a skill that would teach more and be useful in future. – David O'Meara Feb 22 '11 at 11:31

Run sudo synaptic, search for sun java, mark it for installation, and click Apply.

share|improve this answer
thanks, but how to add envoronment variable to path – jnivasreddy Feb 22 '11 at 10:37
Just link /usr/bin/java to the installed java binary. – BZ1 Feb 22 '11 at 10:39
PATH=$PATH:/home/user/path/to/executable here path to jdk/bin – Jigar Joshi - Feb 22 '11 at 10:43
To add JAVA_HOME and JDK_HOME to your environment variables, one usual way is to add their definition to /etc/environment – Delete Feb 22 '11 at 11:17