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

I have installed java but I could not get any java command to work! Below shows what I get when I try to run java commands:

sultan@ubuntu:~$ java
The program 'java' can be found in the following packages:
 * default-jre
 * gcj-4.6-jre-headless
 * openjdk-6-jre-headless
 * gcj-4.5-jre-headless
 * openjdk-7-jre-headless
Try: sudo apt-get install <selected package>

sultan@ubuntu:~$ sudo apt-get install openjdk-7-jre
[sudo] password for sultan:
Reading package lists... Done
Building dependency tree       
Reading state information... Done
openjdk-7-jre is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
share|improve this question

closed as off-topic by A.B., Fabby, karel, David Foerster, Pilot6 Aug 17 '15 at 14:02

This question appears to be off-topic. The users who voted to close gave these specific reasons:

  • "This describes a problem that can't be reproduced that seemingly went away on its own or was only relevant to a very specific period of time. It's off-topic as it's unlikely to help future readers." – karel, David Foerster, Pilot6
  • "This question is specific to an end of life Ubuntu release. These are no longer supported and are therefore off-topic here. To upgrade, see: How to install software or upgrade from old unsupported release?" – A.B., Fabby
If this question can be reworded to fit the rules in the help center, please edit the question.

My java executable (from openjdk) is in /usr/bin. Is the executable there on your system? Is /usr/bin not on your path for some reason (do echo $PATH to see). – Ash Mar 29 '13 at 1:38
What's the output of update-java-alternatives -l? – Eric Carvalho Mar 29 '13 at 2:16
I installed sun jdk.. it seems to have been successfully installed. THANKS GUYS – Sultan Abraham Mar 29 '13 at 4:10
If you have solved your problem, please consider closing your question or, better yet, answer it yourself. Thanks :) – Mochan Apr 2 '13 at 8:05