1

I'm install OpenJDK Java on my Ubuntu 12.04 desktop using the following command:

sudo apt-get install openjdk-7-jdk

But I keep having java not found:

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>

What's the reason here? I tried reinstall, even deleting /usr/lib/jvm but it still doesn't work.

There is no java in /usr/lib/jvm/java-1.7.0-openjdk-amd64/bin, only javac and other things. Also when I run javac, this is the error:

javadoc: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory
3
  • 1
    The last line, Try: sudo apt-get install <selected package>, doesn't say nothing? Jun 25, 2013 at 15:30
  • I thought I should have java after installing openjdk-7-jdk? They are the other packages? Jun 25, 2013 at 15:31
  • I installed java perfectly on my laptop (with a clean ubuntu installation). I guess my desktop has some missing things, so there's a lot of errors. Jun 25, 2013 at 15:41

1 Answer 1

1

To install OpenJDK Java 7 Runtime, just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command(s) below:

sudo apt-get install openjdk-7-jre

The openjdk-7-jre package contains just the Java Runtime Environment. If you want to develop Java programs then install the openjdk-7-jdk package afterwards. Then you can do

sudo apt-get install icedtea6-plugin

Not the answer you're looking for? Browse other questions tagged .