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:
Java language improvements
JEP 409: Sealed Classes – Sealed classes and interfaces restrict other classes or interfaces from extending or implementing them. This enhancement is another addition to Project Amber, which aims to increase developer productivity through the evolution of the Java language.
Library updates and improvements.
JEP 306: Restore Always Strict Floating-Point Semantics – The Java programming language and the Java Virtual Machine originally only had strict floating-point semantics. Starting with Java 1.2, minor variations on these strict semantics were allowed by default to accommodate the limitations of the then-current hardware architectures. These variations are no longer useful or necessary, so they were removed by JEP 306.
JEP 356: Enhanced Pseudo-Random Number Generator – Provides new interface types and implementations for pseudo-random number generators (PRNGs). This change improves interoperability between different PRNGs and makes it easier to request an algorithm based on requirements rather than hard-coding a specific implementation.
JEP 382New macOS Rendering Pipeline – Implements a Java 2D pipeline for macOS using the Apple Metal API. The new pipeline will reduce the JDK’s dependency on Apple’s deprecated OpenGL API.
New platform support.
JEP 391: macOS AArch64 Port – JDK ports for the macOS/AArch64 platform. This port will allow Java applications to run natively on the new Arm 64-based Apple Silicon computers.
Moving and deletion.
JEP 398: Deprecate the Applet API for removal – All web browser vendors have either removed support for Java browser plugins or announced plans to do so. The Applet API was deprecated, but not removed, in Java 9 in September 2017.
JEP 407: Remove RMI Activation – Removes the Remote Method Invocation (RMI) activation mechanism, preserving the rest of the RMI.
JEP 410: Remove experimental AOT and JIT compilers – The experimental Java-based ahead-of-time (AOT) and just-in-time (JIT) compilers were experimental features that didn't see widespread adoption. Since they were optional, they were already removed from JDK 16. This JEP removes these components from the JDK source code.
JEP 411Security Manager Deprecation for Removal – Security Manager dates back to Java 1.0. It hasn't been the primary means of protecting client-side Java code for many years, and it's rarely been used to protect server-side code. Removing it in a future release will help eliminate a significant maintenance burden and allow the Java platform to move forward.
Future-proof Java programs.
JEP 403: Strongly encapsulate JDK internals – It will no longer be possible to relax strong encapsulation of internals via a single command-line option, as was possible in JDK 9 through JDK 16. You will still be able to access existing internal APIs, but you will now need to list, as command-line parameters or JAR file manifest attributes, each of the packages that needs to be relaxed. This change will result in more secure applications and fewer dependencies on non-standard JDK internal implementation details.
Previews and incubators for later JDK releases
JEP 406: Pattern matching for switch (preview) – Allows testing of an expression against multiple patterns, each with a specific action, so that complex data-driven queries can be expressed concisely and safely.
JEP 412: External Memory and Function (Incubator) APIs – Enhancements to the Incubator APIs introduced in JDK 14 and JDK 15 enable Java programs to interoperate with code and data outside of the Java runtime. By efficiently invoking external functions (i.e., code outside the JVM) and safely accessing external memory, these APIs enable Java programs to call native libraries and process native data without the fragility and complexity of the Java Native Interface (JNI). These APIs are being developed as part of Project Panama, which aims to improve the interaction between Java and non-Java code.
JEP 414: Vector API (Second Incubator) – Allows you to express vector computations that are reliably compiled at runtime to optimized vector instructions on supported CPU architectures, achieving performance superior to equivalent scaling computations.
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.deb
// Instalar Oracle Java JDK 17
$ sudo dpkg -i jdk-17_linux-x64_bin.deb
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 version "17.0.11" 2024-04-16 LTS
Java(TM) SE Runtime Environment (build 17.0.11+7-LTS-207)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.11+7-LTS-207, 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 update-alternatives --config java
Simply enter a selection number to choose which Java executable should be used by default.
Setting Environment Variables in Java on Debian Linux
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:
$ sudo dpkg -r jdk-17_linux-x64_bin.deb
$ 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 Debian Linux and make it work perfectly with the Oracle x64 DEB binary.