2

Application use java. When run script, it returns

./browser.sh ./browser.sh: 7: ./browser.sh: java: not found

I check java version:

java -v
The program 'java' can be found in the following packages:
 * default-jre
 * gcj-4.8-jre-headless
 * openjdk-7-jre-headless
 * gcj-4.6-jre-headless
 * openjdk-6-jre-headless
Try: sudo apt-get install <selected package>

Which package should I install?

minto
  • 831

3 Answers3

3

You could install the default-jre, that is openjdk-7.

This should be the more stable of all jre.

3

Very easy :

sudo add-apt-repository ppa:webupd8team/java

After that, update package lists via:

sudo apt-get update

To install Oracle Java 8, run:

sudo apt-get install oracle-java8-installer

Change the number 8 to 6 (or 7) in the code to install Java 6 (or 7).

To set the default Java, run:

sudo apt-get install oracle-java8-set-default

Also change number 8 to the Java version you want.

Finally check whether everyting is OK:

java -version
Nullpointer
  • 1,191
  • 4
  • 16
  • 34
0

The best way to install JDK on ubuntu is manually by downloading from oracle. You can refer following documentation for easy installation.

6 Easy way to install Java JDK on Ubuntu