14 C
Texas
Melhttp://www.osradar.com
Guru Unix /Linux and GNU supporter

How to install Java on OpenSuse 15 Leap?

Recently, Oracle released a new version of Java, the well-known software platform that includes its development components and virtual machine. Inside the development kit, we have a new version of the virtual machine and an update of the libraries that compose it.

If at this point in the game, you don’t know what Java is, we can tell you that it is a High-Level, Object Oriented, Multi-Purpose Programming Language. It can be used in PC, mobile and other technologies.It is highly popular and surely, Java is present in the construction of the applications we use every day.

Downloading the necessary packages

The best way to get java is to go to the Oracle downloads section.

1.- Downloading Java
1.- Downloading Java

- Advertisement -

In the image we can see that there are 3 downloads available, one that is the JDK and the other that is JRE. So, which one should we download? Only JDK and JRE.

We will briefly explain, the JDK is the Java Development Kit, that is, the package provides all the necessary tools to develop Java applications. As stated above, these applications can be focused on the desktop, the web or mobile phones.

In contrast to the JRE, are the set of utilities that are required to run Java applications, therefore, in this package is the Java Virtual Machine. The JVM is the program that executes the Java code previously compiled (bytecode) while the standard class libraries are the ones that implement the Java API.

Then we proceed to download both packages. Let’s get the JDK first. In the following image we must choose the .rpm package that is suitable for OpenSUSE, it is also suitable for Fedora. Once the license agreement is accepted we can start the download.

2.- Downloading JDK
2.- Downloading JDK

In the following image we must choose the .rpm package that is suitable for OpenSUSE, it is also suitable for Fedora. Once the license agreement is accepted we can start the download.

We’re doing the same thing with the JRE.

3.- Downloading JRE
3.- Downloading JRE

Installing the downloaded packages

An OpenSUSE installation contains the community version of Java that we must remove in order to use the official version without problems.

           sudo zypper remove java-10-openjdk-headless java-10-openjdk

4.- Removing openjdk
4.- Removing openjdk

Installing .rpm packages is really easy, and we can do it from the terminal to make the process very fast.

          sudo rpm -i file_path.rpm

In my case:

          sudo rpm -i Downloads/jdk-10.0.1_linux-x64_bin.rpm

 

And then:

          sudo updates-alternatives –config java

5.- Configuring java
5.- Configuring java

Finally, we test the installation result with the commands:

java –version

          javac –version

6.-Checking the installation
6.-Checking the installation

And as we can see, the result for the terminal is the installed version, indicating that the process was correct.

Installing Java in a GNU/LINUX distribution is not as complicated as it used to be, thanks to the availability of packages in its download section. It is a great programming language of high level, quite well known and with a lot of support behind it.

- Advertisement -
Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"

4 COMMENTS

  1. Not working for me on installing. In a new (not upgraded) OpenSUSE 15 installation, when installing, it ended with:
    …..
    ng’: No existe el fichero o el directorio
    cp: no se puede efectuar `stat’ sobre ‘/usr/java/jdk-10.0.2/lib/desktop/icons/hicolor/48×48/apps/sun-javaws.png’: No existe el fichero o el directorio
    update-alternatives: utilizando /usr/java/jdk-10.0.2/bin/java para proveer /usr/bin/java (java) en modo automático
    update-alternatives: error: la alternativa appletviewer no puede una esclava de javac: es ya una esclava de java
    advertencia:%post(jdk-10.0.2-2000:10.0.2-ga.x86_64): macro de ejecución de guión fallido, estado de terminación 2

    so, “updates-alternatives” doesn’t exist and “javac –version” shows:
    javac: invalid flag: –version
    Usage: javac
    use –help for a list of possible options

    and “java –version” shows:
    Error: no se ha encontrado o cargado la clase principal –version
    Causado por: java.lang.ClassNotFoundException: –version

  2. Definitively, is NOT WORKING. Despite I installed JRE I had forgotten, “sudo updates-alternatives –config java” doesn’t work. Doesn’t exist.

    Any suggestion?

    Thank you

LEAVE A REPLY

Please enter your comment!
Please enter your name here



Latest article