Java jdk 8 deb

How to install OpenJDK 8 on Debian 10 (Buster)

In this tutorial, I will show you how to install OpenJDK 8 on Debian 10 (Buster). The Java Development Kit (JDK) is a software development environment used for developing Java applications and applets. It includes the Java Runtime Environment (JRE), an interpreter/loader (java), a compiler (javac), an archiver (jar), a documentation generator (Javadoc) and other tools needed in Java development.

Pre-requisites

    • Debian 10 (Buster) install with root access
    • apt install -y wget gnupg software-properties-common

    1. Add AdoptOpenJDK Repo

    We need to add adopt OpenJDK repo in order to install OpenJDK 8 on Debian.

    wget -qO — https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | sudo apt-key add —

    sudo add-apt-repository —yes https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/

    2. Install Java 8

    Here we will use apt to install Java 8 on Debian Buster

    $ apt install adoptopenjdk-8-hotspot -y

    3. Check java Version

    Now after installing open JDK check the version using the following command

    $ java -version
    openjdk version «1.8.0_222»
    OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_222-b10)
    OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.222-b10, mixed mode)

    4. Set Java Home Environment

    We need to set Java Home Environment Variable in order to use java with some applications. Let’s get started.

    $ sudo update-alternatives —config java
    There is only one alternative in link group java (providing /usr/bin/java): /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
    Nothing to configure.

    Option 1: Set Environment Variable

    $ echo $JAVA_HOME
    /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java

    Option 2: Adding in .bash_profile

    In this option, I will add an entry in .bash_profile.

    and paste the following and save and quit.

    $ echo $JAVA_HOME
    /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java

    If you have any issues using this tutorial please feel free to comment below.

    7 Comments Posted

    $ apt install openjdk-8-jdk Casues: Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    E: Unable to locate package openjdk-8-jdk Debian 10 starts at Java11, apparently, so this doesn’t actually work, unless you changed something else

    Hey Sam, I can install it by using all the above commands.
    apt list —installed | grep jdk
    adoptopenjdk-8-hotspot/buster,now 8u232-b09-2 amd64 [installed]

    Hey, this worked perfectly! Thank you for publishing this info. I installed Java 8 and then went to install Minecraft and everything worked first time!
    The ‘vim’ problem noted by someone earlier was good to know, I used gedit instead. Thank you!

    Leave a Reply Cancel reply

    Recent Posts

    Newsletter

    This website uses cookies to improve your experience. We’ll assume you’re ok with this, but you can opt-out if you wish. Cookie settingsACCEPT

    Privacy Overview

    This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.

    Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.

    Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.

    Источник

    How To Install Oracle Java 8 In Debian Via Repository [JDK8]

    The Oracle JDK License has changed for releases starting April 16, 2019.

    The new Oracle Technology Network License Agreement for Oracle Java SE is substantially different from prior Oracle JDK licenses. The new license permits certain uses, such as personal use and development use, at no cost — but other uses authorized under prior Oracle JDK licenses may no longer be available. Please review the terms carefully before downloading and using this product. An FAQ is available here.

    Oracle Java downloads now require logging in to an Oracle account to download Java updates, like the latest Oracle Java 8u211 / Java SE 8u212. Because of this I cannot update the PPA with the latest Java (and the old links were broken by Oracle).

    For this reason, THIS PPA IS DISCONTINUED (unless I find some way around this limitation).

    Oracle Java 8 was released yesterday and it can be installed in Debian by using the WebUpd8 Java PPA repository.

    Usually, the packages available in Launchpad PPAs don’t support Debian because they are built against specific Ubuntu libraries, but since the WebUpd8 Oracle Java PPA contains just an installer, it works on Debian too.

    Using this PPA repository, you’ll be able to install Oracle Java 8 (which includes both JRE8 and JDK8) in Debian for both 32bit and 64bit as well as ARM (ARM v6/v7 Hard Float ABI — there’s no JDK 8 ARM Soft Float ABI archive available for download on Oracle’s website).

    The installer automatically downloads and installs Oracle JDK8, but no actual Java files are available in our repository (that’s not allowed by the Oracle Java license).

    For Ubuntu / Linux Mint installation instructions, see: Install Oracle Java 8 In Ubuntu Via PPA Repository [JDK8]

    Install Oracle Java 8 (both JDK8 and JRE8) in Debian

    To add the WebUpd8 Oracle Java PPA repository and install Oracle Java 8 in Debian, use the following commands:

    su - echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main" | tee /etc/apt/sources.list.d/webupd8team-java.list echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main" | tee -a /etc/apt/sources.list.d/webupd8team-java.list apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886 apt-get update apt-get install oracle-java8-installer exit

    And that’s it, Oracle Java 8 should now be installed and you should get automatic updates for future Oracle Java 8 versions, under Debian.

    Previously, this package would increment the Java priority to make it default. The oracle-java8-installer package now sets the Java priority to 1081, and that may or may not set it as default, depending on other Java packages you may have installed (for instance, if Java 7 is also installed, Java 8 becomes default, but if Java 9 is installed, Java 8 doesn’t become default).

    To make Java 8 default, you must install the «oracle-java8-set-default» package (which configures the Java environment variables and sets it as default), which I added as a «Recommended» package to «oracle-java8-installer».

    For instance, in Ubuntu, recommended packages are automatically installed, so «oracle-java8-set-default» should be installed when installing «oracle-java8-installer». In Linux Mint on the other hand, recommended packages are not installed by default, so you must install this package manually if you want to set Oracle Java 8 as default.

    So, if you want to set Oracle Java 8 as default, no matter what other Java versions are installed, make sure that you install the oracle-java8-set-default package (which, again, should be automatically installed with the main Oracle Java Installer package in Ubuntu, but not in Linux Mint):

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

    If you don’t want to make Oracle Java 8 default (it might still be set as default, depending on what other Java versions you may have installed), install the oracle-java8-installer with «—no-install-recommends»:

    sudo apt-get install --no-install-recommends oracle-java8-installer

    Note: removing the oracle-java8-set-default package does not undo all the changes (I have yet to find a way to do this properly). If you don’t want to set it as default, remove both oracle-java8-installer and oracle-java8-set-default packages, and then install oracle-java8-installer with «—no-install-recommends» (like mentioned above).

    Tip: if you’re behind a firewall / router that blocks some of the redirects required to download the Oracle Java archive, you can download the JDK tar.gz archive manually and place it under /var/cache/oracle-jdk8-installer — then, installing the «oracle-java8-installer» package will use the local archive instead of trying it to download it itself.

    After installing Oracle Java and the «oracle-java8-set-default» package, you can check out the Java version on your system by using these commands:

    java version "1.8.0_111" Java(TM) SE Runtime Environment (build 1.8.0_111-b14) Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)

    For how to install Oracle Java 7 in Debian, see THIS article.

    For Oracle Java 9, see THIS article.

    How to accept the Oracle JDK8 license automatically

    The Oracle Java 8 installer requires you to accept the Oracle license before the installation begins. If for some reason you want to accept the license automatically, you can use the following command:

    echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections
    echo oracle-java8-installer shared/accepted-oracle-licence-v1-1 boolean true | sudo /usr/bin/debconf-set-selections

    Update2 : if you’re looking for Oracle JDK 11, it’s available in a different PPA. The same PPA also has Oracle Java 15.

    Источник

    Читайте также:  Максимальное целое число java
Оцените статью