Results 1 to 7 of 7

Thread: Oracle jdk14 installation

  1. #1
    Join Date
    Sep 2015
    Beans
    7

    Oracle jdk14 installation

    Hey Guys, I am using Ubuntu 20.04 amd64 and am trying to install Oracle JDK 14 and have downloaded the file: jdk-14.0.1_linux-x64_bin.deb which I am attempting to install using the command:

    $ sudo dpkg -i Downloads/jdk-14.0.1_linux-x64_bin.deb

    However, after installation, when I try to see whether java is installed using:

    $ javac -version

    OR

    $ java -version

    It doesn't show any output. What's going wrong?

    Thanks!


    SOLVED
    Last edited by arjun13; July 13th, 2020 at 02:14 PM.

  2. #2
    Join Date
    Nov 2012
    Location
    Halloween Town
    Beans
    Hidden!
    Distro
    Xubuntu Development Release

    Re: Oracle jdk14 installation

    Thread moved to General Help for a better fit

  3. #3
    Join Date
    May 2010
    Beans
    3,232

    Re: Oracle jdk14 installation


  4. #4
    Join Date
    Sep 2015
    Beans
    7

    Re: Oracle jdk14 installation

    I read the URL you provide and after the command:
    $ sudo dpkg -i jdk-14.0.1_linux-x64_bin.deb

    I use the following command:
    $ update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk-14.0.1/bin/java 100

    To check whether Java is installed:
    $ java -version
    java version "14.0.1" 2020-04-14
    Java(TM) SE Runtime Environment (build 14.0.1+7)
    Java HotSpot(TM) 64-Bit Server VM (build 14.0.1+7, mixed mode, sharing)


    However:
    $ javac -version

    Command 'javac' not found, but can be installed with:.....

    Also, the command:
    $ whereis java
    java: /usr/bin/java /usr/share/java

    I think that it installed JRE and not JDK.
    How can I fix this?

    Thanks!

  5. #5
    Join Date
    Dec 2014
    Beans
    2,566

    Re: Oracle jdk14 installation

    update-alternatives updates the link-structure for a single program file (in this case /usr/bin/java is linked to /etc/alternatives/java which then points to the actual executable). You can either use update-alternatives for every single executable that's part of the jdk or use update-java-alternatives which will do it in one stroke for a whole jdk / jre.

    Holger

  6. #6
    Join Date
    Sep 2015
    Beans
    7

    Re: Oracle jdk14 installation

    Can you provide the command using "update-java-alternatives"?

  7. #7
    Join Date
    Dec 2014
    Beans
    2,566

    Re: Oracle jdk14 installation

    Use 'update-java-alternatives --list' to get the names of the java runtime environments and java development kits for which there are '."name".jinfo' files in /usr/lib/jvm, then use 'update-java-alternatives --set "name"' to set an alternative to use. The "name" is shown in the first column of the output of 'update-java-alternatives --list'.

    Holger

    PS: like for most commands, there's a man page for update-java-alternatives.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •