OpenJDK 17 on Debian, Ubuntu and MX-Linux: Complete Guide.

Advertisement

JDK 17 is the open source reference implementation of version 17 of the platform Java SE, as specified by JSR 390 in the Java Community Process.

JDK 17 reached general availability on September 14, 2021. Production-ready binaries under GPL are available from Oracle; binaries from other vendors will follow shortly.

The features and schedule for this release were proposed and tracked through the JEP Process, as modified by the JEP 2.0 proposal. The release was produced using the JDK Release Process (JEP 3).

Java is a popular programming language that allows you to run programs on many platforms, including Fedora. If you want to create Java programs, you need to install a JDK (Java Development Kit). If you want to run a Java program, you can do so in a JVM (Java Virtual Machine), which is provided with JRE (Java Runtime Environment)When in doubt, install the JDK because it is sometimes necessary, even if you don't intend to write Java programs.

There are many versions of Java, and also many versions of each version. If you simply want to run a specific application, consult that software's documentation to see which versions of Java are supported or have been tested. Most Java applications run on one of the following:

OpenJDK: an open-source implementation of the Java platform, standard edition. This version is the preferred version and is included in Debian 12.

Oracle Java SE: Debian 12 no longer distributes the old Oracle SE.

You can find the following versions:

Support versions to long-term LTS, currently 1.8, 11, 17.

Currently, we are in the OpenJDK 21 LTS.

OpenJDK It is the free version of the Java development platform under the concept of an object-oriented language. It is the result of constant efforts by the company called Sun Microsystems. This implementation is listed within the license GPL of GNU with one exception of links, so some of the components of Java class folders and websites are excluded from the license terms in order to be considered within the version stipulated as GNU.

Advertisement

OpenJDK It is the official reference implementation since Java SE 7.

Characteristics

306: Restore always strict floating-point semantics
356: Improved Pseudo-Random Number Generators
382: New macOS rendering pipeline
391: macOS/AArch64 port
398: Deprecate Applet API for removal
403: Strongly encapsulate JDK internals
406: Pattern Matching for Switch (Preview)
407: Remove RMI Activation
409: Sealed Classes
410: Remove experimental AOT and JIT compiler
411: Deprecate security manager for removal
412: External Function and Memory API (Incubator)
414: Vector API (second incubator)
415: Context-specific deserialization filters


JDK 17 will be a long-term support (LTS) release from most vendors.

// Instala Java 17 completo.
$ sudo apt install openjdk-17*
// O instala lo necesario y justo para un usuario java y programador Java.
$ sudo apt install openjdk-17-jdk openjdk-17-demo openjdk-17-doc openjdk-17-jre 

Plugins for OpenJDK 17 integration:

$ sudo apt install jtreg7 java-package uwsgi-app-integration-plugins

Switching between Java versions

You may have multiple versions of Java installed on your system, you can switch from one.

After running this command, you will see a list of all installed Java versions, select the one you want to use by default:

$ sudo update-alternatives --config java

Simply enter a selection number to choose which Java executable should be used by default.

Verify that we have Java 17 installed on the operating system and fully functional and everything ready to run Java programs and even develop programs and software in the Java 17 programming language in a free environment with a GPL3 license:

$ java -version
openjdk version "17.0.10" 2024-01-16
OpenJDK Runtime Environment (build 17.0.10+7-Debian-1deb12u1)
OpenJDK 64-Bit Server VM (build 17.0.10+7-Debian-1deb12u1, mixed mode, sharing)

Finally, we put a source code in Java 17 that will be presented as follows:

public class HolaMundo {

public static void main(String[] args) {        
    System.out.println("Hola ojosdegato");
}

}

To compile and run this code we will have to execute the following statements:

$ javac HolaMundo.java
$ java HolaMundo
Hola ojosdegato

Conclusions

We now have fully functional Java version 17 of OpenJDK-17 LTS extended support version on our Debian Linux operating system to open Java programs and codes on our computer and for programming Java applications along with its query API.

Our score
Click to rate this post!
(Votes: 0 Average: 0)
Advertisement
Share on social media...

Deja un comentario

Your email address will not be published. Required fields are marked *

Basic information on data protection
ResponsibleJavier Cachón Garrido +info...
PurposeManage and moderate your comments. +info...
LegitimationConsent of the concerned party. +info...
RecipientsAutomattic Inc., USA to spam filtering. +info...
RightsAccess, rectify and cancel data, as well as some other rights. +info...
Additional informationYou can read additional and detailed information on data protection on our page política de privacidad.

Este sitio usa Akismet para reducir el spam. Aprende cómo se procesan los datos de tus comentarios.

Scroll al inicio

Descubre más desde javiercachon.com

Suscríbete ahora para seguir leyendo y obtener acceso al archivo completo.

Seguir leyendo