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
Dzung Nguyen
  • 111
  • 5

1 Answers1

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
Volker Siegel
  • 13,065
  • 5
  • 49
  • 65
Mitch
  • 107,631