![]() ![]() Now it can be enabled in the G1 as well by running java with a new +XX:+UseNUMA command-line option. This feature has been implemented in the parallel garbage collector for a long time. By the way, NUMA stands for Non-Uniform Memory Access. JEP 345 improves the G1 garbage collector by implementing NUMA-aware memory allocation. Java 14 contains multiple enhancements in garbage collection. The JEP’s authors provided quite a lot of useful information about the new tool.Īlthough the jpackage tool is available in JDK 14, it’s delivered as an incubator module which means that the functionality is not guaranteed to be stable and may be revised in a future release. It takes the lib/main.jar file and produces a package in the format most appropriate for the system on which it is run. $ jpackage -name myapp -input lib -main-jar main.jar \ Here is an example of how the new tool can be used: Here is a list of supported package formats: JEP 343 introduces the jpackage tool which packages a Java application into a platform-specific package that includes all of the necessary dependencies. This would allow Java applications to be distributed, installed, and uninstalled in a way that is familiar to users. It would be much better if the Java application were an installable package such as MSI on Windows or DMG on Mac. However, it’s not very convenient especially for a user of the application. Packaging Tool (Incubator)Ĭurrently, a Java application is usually distributed as a simple JAR file. If you’re interested in the details, the authors of the JEP 358 provided a lot of info about the new feature. Unfortunately, it took 14 years to finally bring it into OpenJDK. By the way, the improvement has been available in SAP’s JVM since 2006. The new info in NullPointerExceptions may be very helpful in analyzing its root cause and make the developer’s life a bit easier. ![]() Then, we can write the following code using the new switch expressions:Įxception in thread "main" :Ĭannot read field "c" because "a.b" is null Let’s assume that we have a enum that describes weekdays. The new switch expressions may help to simplify code in some cases. Making a long story short, Java 14 introduces a new simplified form of a switch block with case L ->. Finally, the new switch expressions are released in Java 14. This update to the Java language was already available in Java 12 and 13 but only as a preview language feature which means it was not enabled by default. (the article has been published on Medium) Let’s take a closer look at the major updates in Java 14: new switch expressions, better NullPointerExceptions, improvements in garbage collection, JFR event streaming and more. Besides ~2400 bug fixes and small enhancements, the new version of Java contains 16 major enhancements which are also called JEPs (Java Enhancement Proposals). Java 14 is going to be released on Mar 17th, 2020. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |