JEP – Devstyler.io https://devstyler.io News for developers from tech to lifestyle Wed, 20 Mar 2024 11:10:31 +0000 en-US hourly 1 https://wordpress.org/?v=6.8.5 Oracle with Java 22 Enhancements, Language Becomes More Accessible for Beginners https://devstyler.io/blog/2024/03/20/oracle-with-java-22-enhancements-language-becomes-more-accessible-for-beginners/ Wed, 20 Mar 2024 11:10:31 +0000 https://devstyler.io/?p=120211 ...]]> Oracle announced new enhancements to Java 22 that include 12 new features to the language aimed at making it more accessible to beginners. These include implicitly declared classes, basic instance methods, improved constructor behavior, string templates, and APIs for foreign functions and memory. The new enhancements will be useful in training novice Java developers.

 

Students will also be able to start writing code without having to learn all the concepts that are inherent in large projects right from the start. This will allow them to learn the language more gradually.

“The new enhancements in Java 22 enable more developers to quickly and easily create applications that are feature-rich, scalable and secure, and that help organizations around the world grow their businesses,” said Georges Saab, senior vice president of Oracle Java Platform and chairman of the OpenJDK board.

The version introduces the use of unnamed variables and templates that are highlighted. These are useful when variable declarations or nested templates are required, although they will not be used. According to Oracle, this new feature will reduce the number of errors, improve the readability of record templates, and increase code maintainability.

Another anticipated feature that has made its way into this release is the API for foreign functions and memory, which allows Java code to interact with code and data outside of the Java Runtime without using the Java Native Interface.

JEP 458 also introduces the ability to allow the Java runtime to run a program that is provided as multiple Java source code files.

Java 22 also includes JEPs in the preview, including APIs for class files and Stream Gatherers, and several in the second preview, such as Structured Concurrency and Scoped Values.

]]>
Jakarta EE 10 Core Profile, OpenJDK, Open Liberty, Payara, Groovy and Quarkus – Updates of Java https://devstyler.io/blog/2021/09/14/jakarta-ee-10-core-profile-openjdk-open-liberty-payara-groovy-and-quarkus-updates-of-java/ Tue, 14 Sep 2021 13:59:04 +0000 https://devstyler.io/?p=71098 ...]]> Last week’s Java roundup for September 6th, 2021, features news from Jakarta EE 10 introducing a new core profile, JEP 417, JDK 18, Open Liberty 21.0.0.10-beta, Payara August 2021 Roadmap Update webinar, Quarkus 2.2.2.Final, a new Micronaut Java library, Hibernate Search 6.1.0.Alpha1, GraalVM Native Build Tools 0.9.5, updates to versions of Groovy, and the JakartaOne Livestream 2021 conference.

OpenJDK

JEP 417, Vector API, has been promoted from Candidate to Proposed to Target status for JDK 18. Along with performance improvements, this JEP proposes to incorporate enhancements in response to feedback from the previous two rounds of incubation: JEP 414, Vector API, and JEP 338, Vector API. JEP 338 was integrated as an incubator module in JDK 16 and JEP 414 has been defined as one of the final JEPs targeted for JDK 17.

JDK 17

JDK 17 is scheduled to be released on today, September 14, 2021.

JDK 18

Build 14 of the JDK 18 early-access builds was made available this past week featuring updates from Build 13 that include fixes to various issues. More details may be found in the release notes.

For both JDK 17 and JDK 18, developers are encouraged to report bugs via the Java Bug Database.

The Road to Jakarta EE 10

Shortly after the Jakarta EE 10 release plan was revealed, the Jakarta EE Working Group introduced the new Jakarta EE Core Profile to complement the existing Platform Profile and Web Profile. This new profile is “focused on providing a minimal foundation for smaller runtimes that are suitable for microservices and also allows for ahead-of-time compilation.”

]]>
Java State API Would Speed App Startup https://devstyler.io/blog/2021/07/27/java-state-api-would-speed-app-startup/ Tue, 27 Jul 2021 14:52:21 +0000 https://devstyler.io/?p=61871 ...]]> Java would be fitted with an API to save state, under a proposal floating in the OpenJDK community as a way to speed up startup times.

Proposed in an OpenJDK discussion group by Anton Kozlov, senior software engineer at Java software provider Azul, the CRaC (Coordinated Restore at Checkpoint) project would research a Java API for coordination between an application and runtime to save and restore state. According to the proposal, the Java runtime would support multiple ways to save the state: virtual machine snapshot, container snapshot, the CRIU (Checkpoint/Restore In Userspace) project on Linux, and other ways.

Java applications can avoid the long startup and warm-up by saving the state of the Java runtime, the proposal says. Saved state would be used to start instances fast. But the proposal also cites challenges. After state has been saved, the execution environment could change. Also, if multiple instances are started from the saved state simultaneously, they should obtain some uniqueness and their executions should diverge at some point.

The proposal states that the practical way to solve these problems is to make Java applications aware of when the state is saved and restored. Then an application will be able to handle environmental changes. Additionally, the application will be able to obtain uniqueness from the environment.

Under the proposal, an API would be devised that is general enough for any underlying mechanism. Also, safety checks would be explored in the API and runtime that would prevent the saving of state if it may not be restored or work correctly after the restore.

The expectation is that the API would be developed under the JEP (JDK Enhancement Proposal) process and fitted into standard Java, but no specific version of Java has yet been targeted for the API. The feature set of the upcoming version of Java, JDK 17, due in September, has already been frozen. In one comment on the proposal, it was suggested that the effort could be synced with a similar proposal at Red Hat. Possible synergies with Project Leyden, to address Java pain points, also were noted.

To smooth the adoption of the API, plans call for making available an org.crac compatibility library. This library would enable the use of the CRaC API before it appears in the mainline JDK. When running on a JDK version that does not support CRaC or the API, the org.crac API layer would act as a “no-op” layer that does nothing useful, but when running on a JDK version that includes CRaC capabilities, the functionality would be exposed and usable through the org.crac APIs, with no changes required to the API-using code.

]]>