Oracle JDK Java 17 LTS: Guide for Fedora Linux.

Advertisement

Oracle announces the release of Java 17.

The latest long-term support release of Java offers thousands of updates, further enhancing the language and platform to help developers be more productive.

Java 17

Oracle today announced the availability of Java 17 The latest version of the world's number one programming and development language platform. Java 17 offers thousands of performance, stability, and security updates, as well as 14 JEPs (JDK Enhancement Proposals) that further improve the Java language and platform to help developers be more productive.

Java 17 is the latest version of long-term support (LTS) within Java's semi-annual release cadence and is the result of extensive collaboration between the Oracle engineers and other members of the global Java developer community through the Open JDK Community and the Java Community Process (JCP). Since the release of the previous JDK 11 LTS three years ago, more than 70 JCPs have been implemented.

Offering a simpler license

Oracle JDK 17 and future JDK releases are intended to simplify Java licensing and rights. They are provided under a free license for use up to a full year after the release of the next LTS release. Oracle also plans to continue providing Oracle OpenJDK releases under the open-source General Public License (GPL), as it has since 2017.

Improved long-term customer support and care

Oracle is collaborating with the Java developer community and Java Processors (JCP) to improve LTS scheduling to give organizations more flexibility in when, or if, they want to migrate to a newer Java LTS release. Oracle proposes that the next LTS release will be Java 21 and plans for availability in September 2023, which will change the LTS release cadence from three years to two years.

With Oracle LTS and Java SE subscription support, customers can migrate to Java 17 at the pace that best suits their needs. Oracle will provide customers with security, performance, and bug fix updates for Java 17 until at least September 2029.

“Over the past three years, we’ve heard how much developers love the latest functionality and features, and we’ve seen the ecosystem truly embrace the six-month release cadence,” said Georges Saab, vice president of development for Oracle’s Java Platform Group. “One of the biggest challenges Java developers face today is that their organization only allows them to use the latest LTS release. By moving LTS releases to every two years, developers working with conservative organizations now have more choice and access to the features they love and want to use.”

“Oracle is making changes that will significantly benefit the Java community by shifting long-term support releases to a two-year cadence and introducing a new, more flexible license that provides free, extended production use of the Oracle JDK,” said Dr. Arnal Dayaratna, vice president of Software Development and Research at IDC. “These changes will give organizations greater flexibility to manage the complexity of developing and deploying modern applications in the cloud, on-premises, and in hybrid environments.”

Accelerating Java Adoption in the Cloud

Java is one of the most successful development platforms of all time, driven by continuous innovations that meet the evolving needs of developers. To accelerate Java adoption in the cloud, Oracle recently introduced Oracle Java Management Service, a new service native to Oracle Cloud Infrastructure (OCI), to help organizations manage Java runtimes and applications on-premises or in any cloud.

Java Management Service provides customers with visibility into their enterprise-wide Java deployments. This encompasses all versions of Java installed in their environment, including versions running in development and production. It also highlights any unplanned Java applications currently running and verifies that all installed versions are up to date with the latest security patches.

JDK 17 includes new language enhancements, library updates, support for new Apple computers, removal and migration of legacy features, and work to help ensure that Java code written today continues to work unchanged in future JDK releases. It also provides a language feature preview and incubation API to gather feedback from the Java community. Updates include:

Advertisement

Java language improvements

JEP 409: Sealed Classes – Las clases e interfaces selladas restringen otras clases o interfaces que pueden extenderlas o implementarlas. Esta mejora es una más del Proyecto Amber, que tiene como objetivo aumentar laproductividad de los desarrolladores a través de la evolución del lenguaje Java.
Library updates and improvements.
JEP 306: Restaurar la semántica de punto flotante siempre estricta – El lenguaje de programación Java y la máquina virtual Java originalmente solo tenían una semántica estricta de punto flotante. A partir de Java 1.2, se permitieron pequeñas variaciones en esta semántica estricta de forma predeterminada para adaptarse a las limitaciones de las arquitecturas de hardware de entones. Estas variaciones ya no son útiles ni necesarias, por lo que fueron eliminadas por la JEP 306.
JEP 356: Generador de números pseudoaleatorios mejorado – Proporciona nuevos tipos de interfaz e implementaciones para generadores de números pseudoaleatorios (PRNG por sus siglas en inglés). Este cambio mejora la interoperabilidad de diferentes PRNG y facilita la solicitud de un algoritmo basado en requisitos en lugar de codificar una implementación específica.
JEP 382: Nueva pipeline de renderizado de macOS – implementa una pipeline Java 2D para macOS utilizando la API de Apple Metal. La nueva canalización reducirá la dependencia de JDK de la obsoleta API OpenGL de Apple.
New platform support.
JEP 391: Puerto macOS AArch64 – Puertos JDK para la plataforma macOS / AArch64. Este puerto permitirá que las aplicaciones Java se ejecuten de forma nativa en los nuevos ordenadores Apple Silicon basados en Arm 64.
Moving and deletion.
JEP 398: Descontinuar la API de Applet para su eliminación – Todos los proveedores de navegadores web han eliminado el soporte para los plugins del navegador Java o han anunciado planes para hacerlo. La API de Applet quedó obsoleta, pero no para su eliminación, en Java 9 en septiembre de 2017.
JEP 407: Eliminar la activación de RMI – Elimina el mecanismo de activación de invocación de método remoto (RMI), preservando el resto de la RMI.
JEP 410: Eliminar el compilador experimental AOT y JIT – El compilador experimental basado en Java ahead-of-time (AOT) y just-in-time (JIT) fueron características experimentales que no tuvieron mucha adopción. Al ser opcionales, ya se eliminaron de JDK 16. Este JEP elimina estos componentes del código fuente de JDK.
JEP 411: Obsolescencia del Security Manager para su eliminación – Security Manager se remonta Java 1.0. No ha sido el medio principal de proteger el código Java del lado del cliente durante muchos años, y rara vez se ha usado para proteger el código del lado del servidor. Eliminarlo en una versión futura ayudará a eliminar una carga de mantenimiento significativa y permitirá que la plataforma Java avance.
Future-proof Java programs.
JEP 403: Encapsular fuertemente los elementos internos de JDK – Ya no será posible relajar la fuerte encapsulación de elementos internos a través de una única opción de línea de comandos, como fue posible en JDK 9 hasta JDK 16. Podrá seguir accediendo a las API internas existentes, pero ahora requerirá enumerar, como parámetros de línea de comandos o atributos de manifiesto del archivo JAR, cada uno de los paquetes cuya encapsulación debe relajarse. Este cambio dará lugar a aplicaciones más seguras y menos dependencias en los detalles de implementación internos no estándar de JDK.
Previews and incubators for later JDK releases
JEP 406: Coincidencia de patrones para el switch (preview) – Permite probar una expresión en múltiples patrones, cada uno con una acción específica, de modo que las consultas complejas basadas en datos se pueden expresar de manera concisa y segura.
JEP 412: API de memoria y función externa (incubadora) – mejora las API de incubación introducidas en JDK 14 y JDK 15 que permiten a los programas Java interoperar con código y datos fuera del tiempo de ejecución de Java. Al invocar de manera eficiente funciones externas (es decir, código fuera de la JVM) y acceder de forma segura a la memoria externa, estas API permiten a los programas Java llamar a bibliotecas nativas y procesar datos nativos sin la fragilidad y complejidad de la interfaz nativa de Java (JNI). Estas APIs se están desarrollando en el marco del Proyecto Panamá que tiene como objetivo mejorar la interacción entre el código Java y el no Java.
JEP 414: API Vectorial (Segunda incubadora) – Le permite expresar cálculos vectoriales que se compilan de manera confiable en tiempo de ejecución para instrucciones vectoriales optimizadas en arquitecturas de CPU compatibles, logrando así un rendimiento superior a los cálculos de escala equivalentes.

Download and install Oracle JDK Java 17 LTS on your Linux operating system.

Download Oracle JDK Java 17 LTS in https://www.oracle.com/cl/java/technologies/downloads/

JDK 17.0.9 Development Kit Downloads
JDK 17 binaries are free to use in production and freely redistributable at no cost under Oracle's No Charge Terms and Conditions (NFTC).

JDK 17 will receive updates under the NFTC, until September 2024. Subsequent updates to JDK 17 will be licensed under the Java SE OTN (OTN) License, and production use beyond the limited free grants of the OTN License will require a fee.

Next, download the package x64 rpm binary for easy installation of Oracle Java JDK 17 (LTS):

// Oracle Java JDK 17
$ wget -q https://download.oracle.com/java/17/latest/jdk-17_linux-x64_bin.rpm
// Instalar Oracle Java JDK 17
$ sudo dnf install jdk-17_linux-x64_bin.rpm

Next, we verify the Java installation by checking that it works on our system and confirming that it is the Oracle version of Java.

$ java --version
java 17.0.9 2023-10-17 LTS
Java(TM) SE Runtime Environment (build 17.0.9+11-LTS-201)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.9+11-LTS-201, mixed mode, sharing

You may have multiple versions of Java installed on your system, you can switch and choose a different version.

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

$ sudo alternatives --config java

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

Setting Environment Variables in Java on Fedora 39

At this point, you need to configure the Java environment variables on your Linux computer. To do this, you can use the following command:

$ cat <<EOF | sudo tee /etc/profile.d/jdk.sh
export JAVA_HOME=/usr/java/default
export PATH=\$PATH:\$JAVA_HOME/bin
EOF

Then, apply the changes by getting your file with the following command:

$ source /etc/profile.d/jdk.sh

We check the creation of the environment variable script in Java.

$ cd /etc/profile.d/
/etc/profile.d$ ls
jdk.sh

We check that the Oracle JDK works and that the Java program compiler and interpreter respond.

We introduce 2 Java commands, the compiler (javac) and the Java interpreter (Java) to check that they respond on the command line.

// el compilador java
$ javac
Usage: javac
where possible options include:
@ Read options and filenames from file
-Akey[=value] Options to pass to annotation processors
--add-modules (,)*
Root modules to resolve in addition to the initial modules, or all modules
on the module path if is ALL-MODULE-PATH.
--boot-class-path , -bootclasspath
Override location of bootstrap class files
--class-path , -classpath , -cp
Specify where to find user class files and annotation processors
-d Specify where to place generated class files
-deprecation
Output source locations where deprecated APIs are used
--enable-preview
Enable preview language features. To be used in conjunction with either -source or --release.
-encoding Specify character encoding used by source files
-endorseddirs Override location of endorsed standards path
-extdirs Override location of installed extensions
-g Generate all debugging info
-g:{lines,vars,source} Generate only some debugging info
-g:none Generate no debugging info
-h
Specify where to place generated native header files
--help, -help, -? Print this help message
--help-extra, -X Print help on extra options
-implicit:{none,class}
Specify whether or not to generate class files for implicitly referenced files
-J Pass directly to the runtime system
--limit-modules (,)*
Limit the universe of observable modules
--module (,), -m (,)
Compile only the specified module(s), check timestamps
--module-path , -p
Specify where to find application modules
--module-source-path
Specify where to find input source files for multiple modules
--module-version
Specify version of modules that are being compiled
-nowarn Generate no warnings
-parameters
Generate metadata for reflection on method parameters
-proc:{none,only}
Control whether annotation processing and/or compilation is done.
-processor [,,…]
Names of the annotation processors to run; bypasses default discovery process
--processor-module-path
Specify a module path where to find annotation processors
--processor-path , -processorpath
Specify where to find annotation processors
-profile
Check that API used is available in the specified profile
--release
Compile for the specified Java SE release. Supported releases: 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17
-s Specify where to place generated source files
--source , -source
Provide source compatibility with the specified Java SE release. Supported releases: 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17
--source-path , -sourcepath
Specify where to find input source files
--system |none Override location of system modules
--target , -target
Generate class files suitable for the specified Java SE release. Supported releases: 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17
--upgrade-module-path
Override location of upgradeable modules
-verbose Output messages about what the compiler is doing
--version, -version Version information
-Werror Terminate compilation if warnings occur
// El intérprete java.
$ java
Usage: java [options] [args…]
(to execute a class)
or java [options] -jar [args…]
(to execute a jar file)
or java [options] -m [/] [args…]
java [options] --module [/] [args…]
(to execute the main class in a module)
or java [options] [args]
(to execute a single source-file program)

Arguments following the main class, source file, -jar ,
-m or --module / are passed as the arguments to
main class.

where options include:

-cp <class search path of directories and zip/jar files>
-classpath <class search path of directories and zip/jar files>
--class-path <class search path of directories and zip/jar files>
              A : separated list of directories, JAR archives,
              and ZIP archives to search for class files.
-p <module path>
--module-path <module path>...
              A : separated list of directories, each directory
              is a directory of modules.
--upgrade-module-path <module path>...
              A : separated list of directories, each directory
              is a directory of modules that replace upgradeable
              modules in the runtime image
--add-modules <module name>[,<module name>...]
              root modules to resolve in addition to the initial module.
              <module name> can also be ALL-DEFAULT, ALL-SYSTEM,
              ALL-MODULE-PATH.
--enable-native-access <module name>[,<module name>...]
              modules that are permitted to perform restricted native operations.
              <module name> can also be ALL-UNNAMED.
--list-modules
              list observable modules and exit
-d <module name>
--describe-module <module name>
              describe a module and exit
--dry-run     create VM and load main class but do not execute main method.
              The --dry-run option may be useful for validating the
              command-line options such as the module system configuration.
--validate-modules
              validate all modules and exit
              The --validate-modules option may be useful for finding
              conflicts and other errors with modules on the module path.
-D<name>=<value>
              set a system property
-verbose:[class|module|gc|jni]
              enable verbose output for the given subsystem
-version      print product version to the error stream and exit
--version     print product version to the output stream and exit
-showversion  print product version to the error stream and continue
--show-version
              print product version to the output stream and continue
--show-module-resolution
              show module resolution output during startup
-? -h -help
              print this help message to the error stream
--help        print this help message to the output stream
-X            print help on extra options to the error stream
--help-extra  print help on extra options to the output stream
-ea[:<packagename>...|:<classname>]
-enableassertions[:<packagename>...|:<classname>]
              enable assertions with specified granularity
-da[:<packagename>...|:<classname>]
-disableassertions[:<packagename>...|:<classname>]
              disable assertions with specified granularity
-esa | -enablesystemassertions
              enable system assertions
-dsa | -disablesystemassertions
              disable system assertions
-agentlib:<libname>[=<options>]
              load native agent library <libname>, e.g. -agentlib:jdwp
              see also -agentlib:jdwp=help
-agentpath:<pathname>[=<options>]
              load native agent library by full pathname
-javaagent:<jarpath>[=<options>]
              load Java programming language agent, see java.lang.instrument
-splash:<imagepath>
              show splash screen with specified image
              HiDPI scaled images are automatically supported and used
              if available. The unscaled image filename, e.g. image.ext,
              should always be passed as the argument to the -splash option.
              The most appropriate scaled image provided will be picked up
              automatically.
              See the SplashScreen API documentation for more information
@argument files
              one or more argument files containing options
-disable-@files
              prevent further argument file expansion
--enable-preview
              allow classes to depend on preview features of this release

To specify an argument for a long option, you can use --= or -- .

Remove jdk 17

If you want to uninstall the Oracle JDK Java 17 from the system, we will enter this command:

$ dnf remove jdk-17_linux-x64_bin.rpm
$ cd /etc/profile.d/
$ rm jdk.sh

Conclusion

Java Java is a general-purpose programming language and environment for developing and running a wide range of programs. In this article, we show you how to install Java (Oracle JDK) on Fedora Linux and make it work perfectly with the Oracle x64 RPM binary.

Our score
Click to rate this post!
(Votes: 0 Average: 0)
Advertisement

Share on social media...

Descubre más desde javiercachon.com

Subscribe to get the latest posts sent to your email.

Deja un comentario

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

Basic information on data protection
Responsible Javier Cachón Garrido +info...
Purpose Manage and moderate your comments. +info...
Legitimation Consent of the concerned party. +info...
Recipients Automattic Inc., USA to spam filtering. +info...
Rights Access, rectify and cancel data, as well as some other rights. +info...
Additional information You can read additional and detailed information on data protection on our page política de privacidad.

Scroll al inicio

Descubre más desde javiercachon.com

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

Seguir leyendo

Hello!

Click on one of our representatives below to chat via Telegram or send us an email to soporte@javiercachon.com

Aid!