Update alternatives ошибка нет альтернатив для java

I have Java 11 and 8 in my Ubuntu 18.04, side by side.
I mean to set Java 8 as the default.

What I get:

    $ sudo update-java-alternatives --set /usr/lib/jvm/java-1.8.0-openjdk-amd64
    update-alternatives: error: no alternatives for mozilla-javaplugin.so
    update-java-alternatives: plugin alternative does not exist: /usr/lib/jvm/java-8-openjdk-amd64/lib/IcedTeaPlugin.so

How can I get both plugins if they exist, work.

I am not sure if using (see this)

    sudo update-java-alternative —jre-headless -s java-1.8.0-openjdk-amd64

is ok, so I did not try it.
Could it break anything?
The Following are results after update-java-alternatives

    $ sudo update-alternatives --config java
    There are 2 choices for the alternative java (providing /usr/bin/java).
  Selection    Path                                            Priority   Status
------------------------------------------------------------
  0            /usr/lib/jvm/java-11-openjdk-amd64/bin/java      1101      auto mode
  1            /usr/lib/jvm/java-11-openjdk-amd64/bin/java      1101      manual mode
* 2            /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java   1081      manual mode

$ java -version
openjdk version "1.8.0_191"
OpenJDK Runtime Environment (build 1.8.0_191-8u191-b12-2ubuntu0.18.04.1-b12)
OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)

This is the opposite change from

update-alternatives: error: no alternatives for mozilla-javaplugin.so

https://ubuntuforums.org/showthread.php?t=2402155

Related:

https://serverfault.com/questions/814064/set-jdk-8-as-the-default-java-on-debian-8

I try to setup nativescript-vue on linux by following steps on nativescript website. when I use this command

sudo update-alternatives —config java

but have an error

update-alternatives: error: no alternatives for java

Please tell me how to fix this problem……

asked Jan 21, 2019 at 11:22

setha va's user avatar

Try

sudo update-alternatives --install /usr/bin/java java  path_to_java 1

In my case the path was /usr/lib/jvm/java-8-openjdk-amd64

Zoe is on strike's user avatar

answered Mar 29, 2019 at 20:34

Max Robbertze's user avatar

1

Do you have java installed?
Check if you do by running java -version in the command line/terminal

answered Feb 28, 2019 at 12:08

Idowu Olawoye's user avatar

0

Перейти к контенту

I have Java 11 and 8 in my Ubuntu 18.04, side by side.
I mean to set Java 8 as the default.

What I get:

    $ sudo update-java-alternatives --set /usr/lib/jvm/java-1.8.0-openjdk-amd64
    update-alternatives: error: no alternatives for mozilla-javaplugin.so
    update-java-alternatives: plugin alternative does not exist: /usr/lib/jvm/java-8-openjdk-amd64/lib/IcedTeaPlugin.so

How can I get both plugins if they exist, work.

I am not sure if using (see this)

    sudo update-java-alternative —jre-headless -s java-1.8.0-openjdk-amd64

is ok, so I did not try it.
Could it break anything?
The Following are results after update-java-alternatives

    $ sudo update-alternatives --config java
    There are 2 choices for the alternative java (providing /usr/bin/java).
  Selection    Path                                            Priority   Status
------------------------------------------------------------
  0            /usr/lib/jvm/java-11-openjdk-amd64/bin/java      1101      auto mode
  1            /usr/lib/jvm/java-11-openjdk-amd64/bin/java      1101      manual mode
* 2            /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java   1081      manual mode

$ java -version
openjdk version "1.8.0_191"
OpenJDK Runtime Environment (build 1.8.0_191-8u191-b12-2ubuntu0.18.04.1-b12)
OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)

This is the opposite change from

update-alternatives: error: no alternatives for mozilla-javaplugin.so

https://ubuntuforums.org/showthread.php?t=2402155

Related:

https://serverfault.com/questions/814064/set-jdk-8-as-the-default-java-on-debian-8

Хочу что бы JDK11 был выбран, по умолчанию, вручную. Ввожу команду:

 sudo update-java-alternatives --list

Мне выдает две версии 8 и 11

java-1.11.0-openjdk-amd64      1111       /usr/lib/jvm/java-1.11.0-openjdk-amd64
java-1.8.0-openjdk-amd64       1081       /usr/lib/jvm/java-1.8.0-openjdk-amd64

Далее выбираю java 11.

 sudo update-java-alternatives --set java-1.11.0-openjdk-amd64 --verbose

И начинают сыпаться ошибки.

resetting java alternatives
update-alternatives: ошибка: нет альтернатив для appletviewer
update-alternatives: ошибка: нет альтернатив для extcheck
update-alternatives: ошибка: нет альтернатив для idlj
update-alternatives: ошибка: нет альтернатив для javah
update-alternatives: ошибка: нет альтернатив для jhat
update-alternatives: ошибка: нет альтернатив для jsadebugd
update-alternatives: ошибка: нет альтернатив для mozilla-javaplugin.so
update-alternatives: ошибка: нет альтернатив для native2ascii
update-alternatives: ошибка: нет альтернатив для policytool
update-alternatives: ошибка: нет альтернатив для schemagen
update-alternatives: ошибка: нет альтернатив для wsgen
update-alternatives: ошибка: нет альтернатив для wsimport
update-alternatives: ошибка: нет альтернатив для xjc

Подозреваю нет альтернатив потому что этих компонентов просто нет в новой джаве, но тогда откуда они взялись?

ОС Дебиан.

The command update-java-alternatives -s jre-8-oracle-x64 is completely valid (found in documentation also here) but I get errors.
The package is also seen in the list of Java packages

root@masi:/home/masi# update-java-alternatives -l
java-1.7.0-openjdk-amd64 1071 /usr/lib/jvm/java-1.7.0-openjdk-amd64
jre-8-oracle-x64 317 /usr/lib/jvm/jre-8-oracle-x64

I do but cannot get jre-8-oracle-x64 work in my system without errors

# https://wiki.debian.org/JavaPackage
# http://unix.stackexchange.com/a/310787/16920
root@masi:/home/masi/Downloads# update-java-alternatives -s java-6-sun
update-java-alternatives: directory does not exist: /usr/lib/jvm/java-6-sun

root@masi:/home/masi/Downloads# ls /usr/lib/jvm/
default-java/                    java-7-openjdk-amd64/
java-1.7.0-openjdk-amd64/        jre-8-oracle-x64/
.java-1.7.0-openjdk-amd64.jinfo  .jre-8-oracle-x64.jinfo

root@masi:/home/masi/Downloads# update-java-alternatives -s jre-8-oracle-x64
update-alternatives: error: no alternatives for appletviewer
update-alternatives: error: no alternatives for extcheck
update-alternatives: error: no alternatives for idlj
update-alternatives: error: no alternatives for jar
update-alternatives: error: no alternatives for jarsigner
update-alternatives: error: no alternatives for javac
update-alternatives: error: no alternatives for javadoc
update-alternatives: error: no alternatives for javah
update-alternatives: error: no alternatives for javap
update-alternatives: error: no alternatives for jcmd
update-alternatives: error: no alternatives for jconsole
update-alternatives: error: no alternatives for jdb
update-alternatives: error: no alternatives for jhat
update-alternatives: error: no alternatives for jinfo
update-alternatives: error: no alternatives for jmap
update-alternatives: error: no alternatives for jps
update-alternatives: error: no alternatives for jrunscript
update-alternatives: error: no alternatives for jsadebugd
update-alternatives: error: no alternatives for jstack
update-alternatives: error: no alternatives for jstat
update-alternatives: error: no alternatives for jstatd
update-alternatives: error: no alternatives for native2ascii
update-alternatives: error: no alternatives for rmic
update-alternatives: error: no alternatives for schemagen
update-alternatives: error: no alternatives for serialver
update-alternatives: error: no alternatives for wsgen
update-alternatives: error: no alternatives for wsimport
update-alternatives: error: no alternatives for xjc

Using the auto-mode does not make sense; maybe, I should be deleting some packages in my system first

root@masi:/home/masi/Downloads# update-alternatives --auto java
update-alternatives: using /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java to provide /usr/bin/java (java) in auto mode

OS: Debian 8.5
Linux kernel: 4.6 of backports
Hardware: Asus Zenbook UX303UA
Java: JRE 8 version 102 Oracle x64

sudo update-alternatives --config java
update-alternatives: error: no alternatives for java

The installed java versions need to be added to update-alternatives:

adding jdk-11 with 10 priority :

sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/java-11-openjdk-amd64/bin/java 10 

adding jdk-15 with 20 priority (suppose you have extracted the tarball to /usr/lib/jvm/ directory. In your case replace /usr/lib/jvm/jdk-15.0.2/bin/java with /usr/local/bin/jdk-15.0.2/bin/java)

sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk-15.0.2/bin/java 20

Check it:

 sudo update-alternatives --list java

/usr/lib/jvm/java-11-openjdk-amd64/bin/java
/usr/lib/jvm/jdk-15.0.2/bin/java

and

sudo update-alternatives --config java

sample output:

There are 2 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                         Priority   Status
------------------------------------------------------------
* 0            /usr/lib/jvm/jdk-15.0.2/bin/java              20        auto mode
  1            /usr/lib/jvm/java-11-openjdk-amd64/bin/java   10        manual mode
  2            /usr/lib/jvm/jdk-15.0.2/bin/java              20        manual mode

Press <enter> to keep the current choice[*], or type selection number: 

Check the java version, in the above example the default version is jdk-15:

java --version

openjdk 15.0.2 2021-01-19
OpenJDK Runtime Environment (build 15.0.2+7-27)
OpenJDK 64-Bit Server VM (build 15.0.2+7-27, mixed mode, sharing)
sudo update-alternatives --config java
update-alternatives: error: no alternatives for java

The installed java versions need to be added to update-alternatives:

adding jdk-11 with 10 priority :

sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/java-11-openjdk-amd64/bin/java 10 

adding jdk-15 with 20 priority (suppose you have extracted the tarball to /usr/lib/jvm/ directory. In your case replace /usr/lib/jvm/jdk-15.0.2/bin/java with /usr/local/bin/jdk-15.0.2/bin/java)

sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk-15.0.2/bin/java 20

Check it:

 sudo update-alternatives --list java

/usr/lib/jvm/java-11-openjdk-amd64/bin/java
/usr/lib/jvm/jdk-15.0.2/bin/java

and

sudo update-alternatives --config java

sample output:

There are 2 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                         Priority   Status
------------------------------------------------------------
* 0            /usr/lib/jvm/jdk-15.0.2/bin/java              20        auto mode
  1            /usr/lib/jvm/java-11-openjdk-amd64/bin/java   10        manual mode
  2            /usr/lib/jvm/jdk-15.0.2/bin/java              20        manual mode

Press <enter> to keep the current choice[*], or type selection number: 

Check the java version, in the above example the default version is jdk-15:

java --version

openjdk 15.0.2 2021-01-19
OpenJDK Runtime Environment (build 15.0.2+7-27)
OpenJDK 64-Bit Server VM (build 15.0.2+7-27, mixed mode, sharing)

Inside a Debian 10 VM I have first installed OpenJDK 11, and it was all OK.
Then I have installed Oracle JDK 13 according to instructions posted in Computing for geeks, that means wget-ting the .deb file and install it with dpkg -i.

I have got no errors, but when running update-alternatives --config java I get this answer:

There is only one alternative in link group java (providing /usr/bin/java): /usr/lib/jvm/java-11-openjdk-amd64/bin/java

Why? How can I switch from one JDK to the other?

dirdi's user avatar

dirdi

3,03114 silver badges34 bronze badges

asked Oct 2, 2019 at 9:41

Sandman42's user avatar

The alternatives are handled by pre- and post-install hooks. There seems to be no hook included in the package you downloaded, but you can easily add an alternative manually:

# update-alternatives --install /usr/bin/java java /path/to/OracleJDKs/java 2
# update-alternatives --install /usr/bin/javac javac /path/to/OracleJDKs/javac 2

Afterwards you should be able to select a Java version by running update-alternatives --config java and update-alternatives --config javac.

However, the java-package package always provided an easy way to install Oracle JDK on a Debian system. Since I have not used it for quiet a while I can not say if it is still compatible with current Java releases.

answered Oct 2, 2019 at 9:52

dirdi's user avatar

dirdidirdi

3,03114 silver badges34 bronze badges

0

I have Java 11 and 8 in my Ubuntu 18.04, side by side.
I mean to set Java 8 as the default.

What I get:

$ sudo update-java-alternatives --set /usr/lib/jvm/java-1.8.0-openjdk-amd64
update-alternatives: error: no alternatives for mozilla-javaplugin.so
update-java-alternatives: plugin alternative does not exist: /usr/lib/jvm/java-8-openjdk-amd64/lib/IcedTeaPlugin.so

How can I fix this?
(I mean to get both plugins if they exist, or to know that they do not exist).

I am not sure if using (see this)

sudo update-java-alternative —jre-headless -s java-1.8.0-openjdk-amd64

is ok, so I did not try it.
Could it break anything?

What I have now (after update-java-alternatives) is

$ sudo update-alternatives --config java
There are 2 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                            Priority   Status
------------------------------------------------------------
  0            /usr/lib/jvm/java-11-openjdk-amd64/bin/java      1101      auto mode
  1            /usr/lib/jvm/java-11-openjdk-amd64/bin/java      1101      manual mode
* 2            /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java   1081      manual mode

$ java -version
openjdk version "1.8.0_191"
OpenJDK Runtime Environment (build 1.8.0_191-8u191-b12-2ubuntu0.18.04.1-b12)
OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)

This is the opposite change from

update-alternatives: error: no alternatives for mozilla-javaplugin.so

https://ubuntuforums.org/showthread.php?t=2402155

Related:

https://serverfault.com/questions/814064/set-jdk-8-as-the-default-java-on-debian-8

I’ve been trying this tutorial:
How To Manually Install Oracle Java on a Debian
to install Java on Debian 8, but I’m getting the following error :
update-alternatives: error: alternative path /opt/jdk/jdk1.8.0_05/bin/java doesn't exist

I checked the directory and observed that the directory actually exists. The output of the ls command is as follows:
-rwxr-xr-x 1 uucp 143 5730 Apr 10 13:53 java

I don’t know how to solve my problem and fix my Java installation. I’ve checked about what uucp actually means but have no idea why it’s there.

I need to get Oracle Java 8 installed.

Rui F Ribeiro's user avatar

Rui F Ribeiro

55.6k26 gold badges146 silver badges225 bronze badges

asked Jul 16, 2015 at 8:25

Tower's user avatar

You’d be far better off using the Debian java-package package to install Oracle Java. It allows you to build a Debian package file from the Oracle Java binaries, a package that can be managed using the regular Debian tools (including update-alternatives).

For Debian 8.x, the currently supported Java versions are (from here):

  • Oracle (http://www.oracle.com/technetwork/java/javase/downloads) :
    • The Java Development Kit (JDK), version 6, 7 and 8
    • The Java Runtime Environment (JRE), version 6, 7 and 8
    • The Java API Javadoc, version 6, 7 and 8

Basically:

  1. Install java-package (apt-get install java-package).
  2. Download (but don’t install) the Oracle Java package from the Oracle site.
  3. Use make-jpkg to build a package from the Oracle Java installer you’ve downloaded.
  4. Install the Debian package you built as part of step 3.

For more information, see here (currently slightly out of date) and the make-jpkg manual page.

Note: Make sure you remove the Oracle Java binaries you manually installed before installing the package you built with make-jpkg, otherwise you are sure to run into problems.

answered Jul 16, 2015 at 8:43

mjturner's user avatar

mjturnermjturner

7,0121 gold badge26 silver badges32 bronze badges

1

java-package is of course a better idea.

For now, your problem can be related to permissions.

chown <current_user>:<whichever_group> /opt/jdk/jdk1.8.0_05/bin/java where current_user is the user you want to run java with (can be root) and chmod -R 755 /opt/jdk/jdk1.8.0_05

And then try.

answered Jul 16, 2015 at 8:47

neuron's user avatar

neuronneuron

1,94110 silver badges19 bronze badges

1

You must log in to answer this question.

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

.

  • Upc exe ошибка приложения
  • Upc exe ошибка uplay
  • Upc exe ошибка ubisoft
  • Uo184 ошибка митсубиси аутлендер xl
  • Uo184 ошибка лансер 10