Wednesday, January 31, 2024

Announcing Oracle GraalVM for JDK 21

Announcing Oracle GraalVM for JDK 21

Oracle is pleased to announce the availability of Oracle GraalVM for JDK 21. This release brings with it new Java 21 features, improvements in Native Image performance, simplified usage of embedded languages, and more.

Project Loom Virtual Threads

First previewed in JDK 19, Project Loom is no longer a preview feature in JDK 21. GraalVM for JDK 21 implements Loom’s virtual threads when running on the JVM and when using Native Image.

Native Image Performance

While executables generated by GraalVM Native Image may be best known for their quick startup time, metrics such as memory usage, peak throughput, and latency are also critically important. With Oracle GraalVM for JDK 21 we see ahead-of-time (AOT) compilation achieving superior results on all metrics when benchmarking the popular Spring PetClinic application. While some developers might expect that JIT compilation would always outperform AOT compilation, the throughput achieved by Native Image generated executables in GraalVM for JDK 21 provide competitive peak performance.

All the following Spring PetClinic benchmark results were obtained with a maximum heap size of 512MB. The two configurations compared below are: a native executable produced by Oracle GraalVM for JDK 21 optimized with profile guided optimization (PGO); the same application running on GraalVM Community Edition for JDK 21 using the C2 JIT compiler. Both configurations use the G1 garbage collector.

Startup (seconds): Native 97% faster

GraalVM (C2 JIT) Oracle GraalVM Native Image (PGO+G1) 
7.09 0.21 

Memory Usage (RSS in MB): Native 38% lower

GraalVM (C2 JIT) Oracle GraalVM Native Image (PGO+G1)
1029 641

99th Percentile Latency (ms): Native 28% lower

GraalVM (C2 JIT)

Oracle GraalVM Native Image (PGO+G1)
7.20 5.15

Throughput (requests/second): On par

GraalVM (C2 JIT)

Oracle GraalVM Native Image (PGO+G1)
11066 11902

With these latest results, we can see that Oracle GraalVM Native Image can provide faster startup time, reduced memory requirements, and lower latency while maintaining throughput making it an ideal choice for microservices, functions, and other workloads where minimizing operating cost is critical.

New Container Images


To support container-based application development and deployment, new container images are available for the Oracle GraalVM JDK and Native Image in the Oracle Container Repository. The `jdk` image can be used to deploy Java applications while the `native-image` container image includes all the tools required to compile applications into native executables.

Faster Compile Times


To reduce application compile times, some optimization phases that were previously included in the default level 2 (-O2) have been moved to a new level 3 (-O3). The level 3 optimizations work best with profile guided optimization, so they are automatically enabled when compiling with `--pgo`. The result is faster default compilation times with no significant impact on application performance. PGO continues to employ the same optimizations as in previous releases.

During development, where the focus is on functionality, not performance, developers can continue to use the “quick build” option (-Ob) to reduce compile times. This option disables most memory and performance optimizations so the resulting executables are not recommended for production deployments.

Source: oracle.com

Monday, January 29, 2024

Unleashing the Power of IoT Certification and Java Card

Unleashing the Power of IoT Certification and Java Card

Introduction


In the ever-evolving landscape of technology, IoT Certification and Java Card have emerged as pivotal players, reshaping the way we interact with and secure our interconnected devices. This comprehensive guide aims to delve into the intricacies of these technologies, providing invaluable insights for both beginners and seasoned professionals.

Understanding IoT Certification


Defining IoT Certification

IoT Certification is the bedrock of a secure and efficient Internet of Things (IoT) ecosystem. It serves as a testament to the device's compliance with industry standards, ensuring seamless communication and interoperability.


Importance in a Connected World

In an era dominated by interconnected devices, obtaining IoT Certification is not just a choice but a necessity. Certified devices instill confidence in consumers, guaranteeing a certain level of security, compatibility, and reliability. From smart homes to industrial automation, the applications are vast and diverse.

Unraveling the Java Card Advantage


The Essence of Java Card Technology

Java Card technology, on the other hand, adds a layer of intelligence to secure elements in devices. It empowers developers to create robust applications that can run on a variety of platforms, offering unparalleled flexibility.

Security Reinvented

With cyber threats on the rise, the security provided by Java Card is a game-changer. It ensures that sensitive information is protected through advanced cryptographic mechanisms, making it an ideal choice for applications where security is paramount.

Navigating the Certification Landscape


Choosing the Right Certification

Selecting the right IoT Certification is crucial. Look for certifications that align with your specific industry and application. Notable certifications include Certified IoT Professional (CIoTP) and IoT Security Practitioner (IoTSP), each catering to different aspects of the IoT spectrum.

Certification Process Demystified

Embarking on the certification journey may seem daunting, but understanding the process can alleviate concerns. Typically involving a combination of testing and documentation, the certification process ensures that your device meets the necessary standards.

Integrating Java Card with IoT Certification


Synergizing Technologies for Enhanced Performance

The fusion of Java Card and IoT Certification creates a powerful synergy. Certified devices equipped with Java Card technology not only adhere to industry standards but also offer unparalleled capabilities, making them stand out in the competitive IoT landscape.

Case Studies: Real-world Applications


Showcasing Success Stories

Explore real-world applications where the integration of IoT Certification and Java Card has led to transformative outcomes. From healthcare to smart cities, the possibilities are limitless, underscoring the importance of embracing these technologies.

Future Trends and Innovations


Anticipating Tomorrow's Solutions

As technology continues to advance, staying ahead of the curve is crucial. Predicting future trends in IoT Certification and Java Card integration is challenging yet essential for businesses looking to remain competitive in a rapidly evolving digital environment.

Conclusion

In conclusion, the synergy between IoT Certification and Java Card is reshaping our technological landscape. As we navigate the complexities of a connected world, embracing these technologies becomes imperative for those seeking not just compliance but excellence in the realm of IoT.

Wednesday, January 24, 2024

Java Virtual Machine Improvements in Java SE 8: Boosting Performance and Functionality

Java Virtual Machine Improvements in Java SE 8: Boosting Performance and Functionality

In the dynamic landscape of programming languages, Java has consistently stood out for its versatility and reliability. With the release of Java SE 8, the Java Virtual Machine (JVM) underwent significant improvements that not only enhanced performance but also added new dimensions to the language's capabilities. In this comprehensive exploration, we delve into the key JVM enhancements in Java SE 8, shedding light on how these changes impact developers and the overall Java ecosystem.

1. Introduction to Java SE 8 and the JVM


Java SE 8, released in 2014, marked a pivotal moment in Java's evolution. One of the focal points of this update was the reinvigoration of the JVM. The JVM serves as the cornerstone for executing Java applications, making any enhancement in its functionality a crucial advancement for developers worldwide.

2. Just-In-Time (JIT) Compilation: A Game-Changer


One of the standout improvements in Java SE 8 was the enhancement of the Just-In-Time (JIT) compilation process. JIT compilation plays a pivotal role in translating Java bytecode into machine code at runtime. The optimization in Java SE 8 resulted in faster execution times, mitigating the notorious startup delays associated with earlier versions.

3. Lambda Expressions: Transforming Development Paradigms


Java SE 8 introduced lambda expressions, a groundbreaking feature that revolutionized the way developers write code. The JVM underwent modifications to efficiently handle these expressions, enabling concise and expressive syntax for handling functionalities like never before. This not only improved code readability but also contributed to enhanced developer productivity.

4. Metaspace: The Evolution of PermGen


In prior Java versions, memory management was often a pain point for developers, particularly with the infamous PermGen space. Java SE 8 addressed this concern by introducing Metaspace, a memory space that dynamically manages class metadata. This not only averted common OutOfMemory errors but also allowed for more scalable and adaptive memory allocation.

5. Parallel and Concurrent Collectors: Optimizing Garbage Collection


Garbage collection is a critical aspect of memory management in Java. Java SE 8 introduced parallel and concurrent collectors, providing more efficient ways to reclaim unused memory. These collectors significantly reduced pause times, enhancing application responsiveness and scalability.

6. Stream API: Simplifying Data Processing


The Stream API in Java SE 8 brought functional programming paradigms to Java, enabling developers to perform parallel operations on streams of data. The JVM optimizations tailored for the Stream API facilitated seamless parallel execution, unlocking unprecedented levels of performance in data processing tasks.

7. Nashorn JavaScript Engine: Bridging the Gap


Java Virtual Machine Improvements in Java SE 8: Boosting Performance and Functionality
Java SE 8 featured the introduction of the Nashorn JavaScript engine, replacing the aging Rhino. This upgrade enhanced the interoperability of Java with JavaScript, providing a more modern and performant scripting environment. The JVM modifications ensured smooth integration, fostering a more cohesive development ecosystem.

8. Improved Security Features: Safeguarding Applications


Security is a paramount concern in today's digital landscape. Java SE 8 addressed various security vulnerabilities by incorporating enhanced cryptographic algorithms and security protocols. The JVM modifications played a pivotal role in fortifying Java applications against potential threats, earning developers a more secure development environment.

9. Default Methods: Facilitating Interface Evolution


Default methods in interfaces were introduced in Java SE 8, allowing developers to add new methods to interfaces without breaking existing implementations. The JVM enhancements ensured seamless integration of default methods, promoting a smoother transition for developers adapting to evolving interface requirements.

10. Conclusion: Java SE 8 – A Paradigm Shift in Java Development


In conclusion, the Java Virtual Machine improvements in Java SE 8 have ushered in a new era of Java development. From performance optimizations to language features like lambda expressions and the Stream API, each enhancement has contributed to making Java SE 8 a milestone release. As developers continue to leverage these improvements, Java remains at the forefront of modern, scalable, and secure application development. Embracing the power of Java SE 8 and its refined JVM, developers are well-equipped to navigate the evolving landscape of software development with confidence and efficiency.

Monday, January 22, 2024

Unveiling the Power of Java Card: A Comprehensive Guide

Unveiling the Power of Java Card: A Comprehensive Guide

Introduction


In the ever-evolving landscape of technology, Java Card emerges as a powerhouse, seamlessly blending security, flexibility, and functionality. In this article, we delve into the definition, use cases, and undeniable benefits of Java Card, aiming to provide a comprehensive understanding that goes beyond the surface.

Defining Java Card


Java Card is a specialized platform that allows Java-based applications to run on resource-constrained devices. These devices, often smart cards, possess limited processing power and memory. However, Java Card harnesses its efficiency by providing a secure and adaptable environment for applications to thrive.

Use Cases Unveiled


1. Secure Transactions

One of the primary use cases of Java Card lies in the realm of secure transactions. Smart cards equipped with Java Card technology become robust tools for financial institutions, offering a secure medium for transactions, protecting sensitive information from potential threats.

2. Identity Verification

The use of Java Card extends into identity verification systems, where the secure execution environment ensures the integrity of personal information. This makes it an ideal candidate for national ID cards, access control systems, and more.

3. Telecommunications

In the realm of telecommunications, Java Card finds application in SIM cards. Its adaptability allows for the execution of diverse applications on a single card, enhancing the user experience while maintaining security standards.

4. Healthcare Solutions

Java Card's versatility reaches healthcare, where it facilitates secure storage and retrieval of patient information on smart cards. This not only streamlines data management but also ensures the confidentiality of sensitive medical records.

Benefits of Embracing Java Card Technology


1. Enhanced Security

Java Card's standout feature is its robust security infrastructure. By leveraging Java's built-in security mechanisms, it creates a secure sandbox for applications to operate, protecting against common threats such as unauthorized access and data breaches.

2. Platform Independence

The platform independence offered by Java Card is a game-changer. Developers can write applications in Java, and these applications can run on any device equipped with a Java Card runtime environment. This not only simplifies development but also ensures widespread compatibility.

3. Flexibility and Adaptability

Java Card's ability to run multiple applications simultaneously on a single card underscores its flexibility. This adaptability is especially valuable in scenarios where a single smart card serves diverse purposes, minimizing the need for multiple cards.

4. Scalability

As technology advances, scalability becomes a crucial factor. Java Card addresses this need by providing a scalable environment that can accommodate the evolving requirements of applications without compromising performance or security.

Conclusion

In conclusion, Java Card stands as a beacon of innovation, combining security, flexibility, and scalability in a singular platform. Its applications range across various industries, making it a versatile solution for the challenges of the digital age. Embracing Java Card technology not only ensures the security of transactions and data but also unlocks a world of possibilities for developers and end-users alike.

Friday, January 19, 2024

Unveiling the Power of Oracle Java Cloud: A Technological Marvel

Unveiling the Power of Oracle Java Cloud: A Technological Marvel

Introduction


In the ever-evolving realm of technology, Oracle Java Cloud stands as a beacon of innovation, providing an unparalleled platform for developers and businesses alike. In this comprehensive exploration, we delve into the intricacies of Oracle Java Cloud, unraveling its capabilities and showcasing why it stands as a technological marvel in the contemporary IT landscape.

Understanding Oracle Java Cloud


What Sets Oracle Java Cloud Apart?

Oracle Java Cloud is not just another cloud solution; it's a dynamic ecosystem designed to empower developers and organizations with cutting-edge features. Unlike conventional cloud platforms, Oracle Java Cloud goes beyond mere infrastructure provision; it seamlessly integrates the power of Java, offering a robust and scalable environment for application development and deployment.

Key Features that Define Excellence

1. Scalability: Oracle Java Cloud adapts to the dynamic needs of businesses, ensuring seamless scalability as applications grow and evolve.

2. Security: With a fortified security architecture, Oracle Java Cloud prioritizes the protection of data and applications, instilling confidence in users.

3. High Performance: Leveraging the prowess of Java, the platform delivers exceptional performance, catering to the demands of resource-intensive applications.

4. Integration Capabilities: Oracle Java Cloud effortlessly integrates with various databases, tools, and services, fostering a cohesive development environment.

Navigating the Oracle Java Cloud Ecosystem


Developing with Ease

Java Cloud streamlines the development process, providing developers with a user-friendly interface and a myriad of tools to expedite coding and debugging. The integrated development environment (IDE) ensures a seamless coding experience, reducing time-to-market for applications.

Deployment Made Effortless

Gone are the days of complex deployment processes. Oracle Java Cloud simplifies deployment, offering automated processes that minimize the risk of errors. Whether it's a small-scale application or a large-scale enterprise solution, the deployment on Oracle Java Cloud is a smooth journey.

Harnessing the Power of Java

Java, renowned for its versatility, is at the heart of Oracle Java Cloud. The platform allows developers to leverage the full potential of Java, tapping into its extensive libraries and frameworks. This not only accelerates development but also ensures the creation of robust and feature-rich applications.

Real-world Applications and Success Stories


Transforming Industries

From healthcare to finance, Oracle Java Cloud has left an indelible mark on various industries. Its adaptability and scalability have empowered businesses to transform their operations, enhancing efficiency and driving innovation.

Case Study: XYZ Corporation

XYZ Corporation, a global leader in technology solutions, experienced a paradigm shift in their IT landscape with Oracle Java Cloud. The platform's seamless integration and robust performance catapulted XYZ Corporation into a new era of digital excellence.

Staying Ahead with Oracle Java Cloud


Future-proofing Your Business

In an era where technological advancements are rapid, future-proofing your business is imperative. Oracle Java Cloud positions itself as a strategic ally, ensuring that your applications and infrastructure are not just current but also ready to embrace the innovations of tomorrow.

Continuous Improvement and Updates

Oracle Java Cloud doesn't rest on its laurels. The platform undergoes continuous improvement, with regular updates and enhancements. This commitment to staying ahead of the technological curve ensures that users always have access to the latest features and security protocols.

Conclusion

In conclusion, Oracle Java Cloud is not merely a cloud platform; it's a catalyst for innovation and progress. Its robust features, seamless integration, and commitment to excellence make it a standout choice for developers and businesses aiming to thrive in the digital landscape.

Wednesday, January 17, 2024

Unveiling the Top Libraries Java Developers Swear By

Unveiling the Top Libraries Java Developers Swear By

In the ever-evolving realm of Java development, choosing the right libraries can make or break your project. As seasoned developers, we understand the pivotal role that libraries play in enhancing functionality, boosting efficiency, and simplifying complex coding tasks. In this comprehensive guide, we delve into the most popular libraries Java developers use, shedding light on their features and benefits.

The Power of Apache Commons


Apache Commons stands tall as one of the most versatile and widely adopted libraries in the Java ecosystem. With an extensive collection of reusable Java components, it provides developers with a treasure trove of utilities, ranging from data structures to input/output tools. Whether you're a novice or an expert, integrating Apache Commons into your project streamlines development and accelerates productivity.

Spring Framework: A Developer's Best Friend


No discourse on Java libraries is complete without a nod to the Spring Framework. Renowned for its robustness and scalability, Spring offers a comprehensive suite of tools for building enterprise-level applications. From dependency injection to aspect-oriented programming, Spring empowers developers to create scalable and maintainable code. The widespread adoption of Spring within the developer community solidifies its status as an indispensable asset.

Hibernate: Transforming Database Interactions


Efficient database interactions are at the core of any successful Java application, and Hibernate excels in this arena. This powerful object-relational mapping (ORM) framework simplifies database access, allowing developers to interact with databases using Java objects. With Hibernate, you can effortlessly bridge the gap between your Java application and relational databases, ensuring seamless data persistence.

Guava: Google's Gift to Java Developers


Developed by Google, Guava is a treasure trove of utilities that simplifies common programming tasks. From handling collections to caching, Guava offers a plethora of well-designed and thoroughly tested libraries. Embraced by Java developers worldwide, Guava's clean and efficient codebase contributes to enhanced application performance.

Log4j: Mastering Logging with Ease


For Java developers, effective logging is non-negotiable, and Log4j is the go-to solution. This robust logging framework facilitates the generation of detailed and informative logs, aiding in debugging and performance optimization. Log4j's flexibility and configurability make it an indispensable tool for Java developers seeking unparalleled control over their application's logging mechanisms.

JUnit: Elevating the Art of Testing


In the realm of software development, testing is paramount, and JUnit stands as a stalwart in the Java testing landscape. This open-source framework simplifies unit testing, allowing developers to validate individual units of code with ease. JUnit's simplicity and integration capabilities make it an integral part of the development lifecycle, ensuring the creation of robust and reliable Java applications.

Sparking Innovation with Apache Spark


In the era of big data, Apache Spark emerges as a game-changer for Java developers. This fast and general-purpose cluster computing system facilitates seamless data processing and analysis. With its lightning-fast processing speed and versatile APIs, Apache Spark empowers developers to unlock new possibilities in big data analytics and machine learning.

Conclusion: Empowering Java Developers Worldwide

As we conclude this exploration of the most popular libraries Java developers use, it becomes evident that the choice of libraries significantly influences the development landscape. From simplifying complex coding tasks to enhancing performance, these libraries serve as the backbone of successful Java projects.

Monday, January 15, 2024

Announcing Graal Cloud Native 4

Announcing Graal Cloud Native 4

We're excited to announce the general availability of Graal Cloud Native 4 based on the recently launched Micronaut® framework 4!

Graal Cloud Native (GCN) is an Oracle build of the open source Micronaut framework. GCN provides a curated set of Micronaut framework modules that simplify cloud application development, are designed to be compiled ahead-of-time with GraalVM Native Image, and are fully supported by Oracle. GCN enables you to easily build portable cloud native Java microservices that start instantly and use fewer resources to reduce compute costs.

What's new in GCN 4?


Let's look at some of the notable changes in this release.

GCN BOM 2.0

We have a new bill of materials (BOM) 2.0 consisting of specific versions of Micronaut framework 4 modules and their dependencies that are compatible and tested together. This reduces the risk of library incompatibility and version mismatches, and saves you from having to test and figure this out yourself.

Include the BOM in your build files using:

Gradle:

dependencies {
    micronautBoms(platform("cloud.graal.gcn:gcn-bom:2.0"))
    ...
}

Maven:

<dependency>
      <groupId>cloud.graal.gcn</groupId>
      <artifactId>gcn-bom</artifactId>
      <version>2.0</version>
      <type>pom</type>
      <scope>import</scope>
    </dependency>

Java 17

GCN 4 is designed and tested to work with Java 17 and later versions.

Gradle 8

If you use Gradle to build your GCN applications, Gradle 8 is the minimum version required to work with GCN 4.

Micronaut Serialization

Micronaut Serialization is a fully featured compile-time replacement for Jackson and is now the default in GCN and Micronaut framework 4. Micronaut Serialization provides reflection-free, fast and secure JSON serialization/deserialization APIs whilst maintaining API compatibility with Jackson annotations.

Shown below is an example of including Micronaut Serialization in your build files for GCN 4 vs GCN 3.8.5:

GCN 4 - Gradle:

dependencies {
    ...
    implementation("io.micronaut.serde:micronaut-serde-jackson")
    ...
}

GCN 3.8.5 - Gradle:

dependencies {
    ...
    implementation("io.micronaut:micronaut-jackson-databind")
    ...
}

GCN 4 - Maven:

<dependency>
      <groupId>io.micronaut.serde</groupId>
      <artifactId>micronaut-serde-jackson</artifactId>
      <scope>compile</scope>
    </dependency>

GCN 3.8.5 - Maven:

<dependency>
      <groupId>io.micronaut</groupId>
      <artifactId>micronaut-jackson-databind</artifactId>
      <scope>compile</scope>
    </dependency>

GraalVM Integration

GCN 4 modules have been designed and tested to work with the latest release of Oracle GraalVM for JDK 17 Native Image available under the GraalVM Free Terms and Conditions (GFTC) license.

The reachability metadata of GCN and Micronaut framework 4 modules and their dependencies is stored in the shared GraalVM Reachability Metadata repository and these modules have been listed on the Libraries and Frameworks Tested with Native Image page. GCN and Micronaut framework 4’s GraalVM integration has been reworked to use this shared metadata repository using the Micronaut Maven and Gradle plugins and GraalVM Native Build Tools. This makes it extremely simple for you to compile your GCN application into a native executable with GraalVM Native Image.

Application Configuration Files


Micronaut framework 4 no longer exposes SnakeYAML as a transitive dependency. So, by default, GCN 4 uses properties files instead of YAML files for application configuration. This reduces the attack surface of your applications by eliminating an external (SnakeYAML) library.

Shown below is an example of an application configuration file for GCN 4 vs GCN 3.8.5:

GCN 4 - Properties File:

micronaut.application.name=dbDemo
flyway.datasources.default.enabled=true
datasources.default.db-type=mysql
datasources.default.dialect=MYSQL
datasources.default.driver-class-name=com.mysql.cj.jdbc.Driver

GCN 3.8.5 - YAML File:

micronaut:
  application:
    name: dbDemo
flyway:
  datasources:
    default:
      enabled: true
datasources:
  default:
    db-type: mysql
    dialect: MYSQL
    driver-class-name: com.mysql.cj.jdbc.Driver

Javax to Jakarta Transition

Micronaut framework 4 has finished the Javax to Jakarta transition. So, GCN uses jakarta.validation instead of javax.validation, jakarta.mail instead of javax.mail, jakarta.transaction instead of javax.transaction, and so on.

Shown below are some examples of GCN 4 vs GCN 3.8.5:

GCN 4:

import jakarta.validation.Valid;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.transaction.Transactional;

GCN 3.8.5:

import javax.validation.Valid;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.transaction.Transactional;

Improved Modularity


Micronaut framework 4 is more modular enabling you to deploy even smaller microservices with reduced native executable and container image sizes, and faster startup. The built-in Validation, Retry, Service Discovery, HTTP Session and WebSocket features have been split into separate modules enabling you to remove this functionality if not needed.

Shown below is an example of using Micronaut Validation in your build files for GCN 4:

GCN 4 - Gradle:
  
annotationProcessor("io.micronaut.validation:micronaut-validation-processor")
implementation("io.micronaut.validation:micronaut-validation")

GCN 4 - Maven:
  
<annotationProcessorPaths>
    <path>
        <groupId>io.micronaut.validation</groupId>
        <artifactId>micronaut-validation-processor</artifactId>
    </path>
</annotationProcessorPaths>
...
 
...
<dependency>
    <groupId>io.micronaut.validation</groupId>
    <artifactId>micronaut-validation</artifactId>
</dependency>

Cloud Modules


GCN and Micronaut framework 4 contain cloud modules with improved support for Oracle Cloud. The Oracle Cloud SDK has been enhanced to be compatible with Micronaut Serialization improving the speed and security of requests and responses by eliminating the need for Jackson. The transport layer for the Oracle Cloud SDK has also been replaced with Netty, avoiding the need for a second HTTP client (Jersey) when writing applications, resulting in smaller container images and improved startup performance. You can also use the new Oracle Cloud Infrastructure Certificates service module to configure and manage HTTPS certificates with automatic refresh of expired certificates.

Object Storage adds Local Storage to ease local development and testing.

GCN Launcher and Guides

The GCN Launcher and Guides have been updated to include the above changes.

GCN VS Code Tooling

With this release, we have made several changes to the Visual Studio Code tooling for Graal Cloud Native.

The GCN VS Code Tools have their own home page, https://www.graal.cloud/gcn/vscode-tools/. Here, you can access the documentation, guides, and watch a video of the tooling in action.

We now support creating and working with Graal Cloud Native 4.0 and Micronaut 4.0 projects.

We've added a Bean and Endpoints explorer view for Micronaut, that also lets you run REST requests against endpoints from within the IDE.

Announcing Graal Cloud Native 4

We've added a CodeLens for 'Run in Continuous' mode. When you update a running Micronaut application launched from the CodeLens, the application is rebuilt and runs automatically, improving the overall developer experience.

Finally, we have released our database tooling that enables you to create Micronaut Data classes directly from an existing database schema (Oracle Autonomous Database). This feature makes it super easy to expose existing databases programmatically through GCN and Micronaut applications!

Announcing Graal Cloud Native 4

JSON Relational Duality Views


The latest version of Micronaut Data JDBC comes with support for Oracle Database 23c and JSON Relational Duality Views. JSON Relational Duality Views provides the benefits of both relational tables and JSON documents, without the trade-offs of either approach.

Other Changes
GCN 4 includes several other notable Micronaut framework 4 features including, Early support for Virtual Threads (Project Loom) with JDK 19 and later, Optimized Netty-based HTTP layer for Virtual Threads, Improved HTTP performance (up to 50% better throughput), experimental support for HTTP/3 and IO_Uring, and a new compile-time expression language (EL).

Source: oracle.com

Friday, January 12, 2024

Unraveling the Power of Collectors, Comparators, and Type Inferencing in Java

Unraveling the Power of Collectors, Comparators, and Type Inferencing in Java

Introduction


Welcome to a comprehensive exploration of the powerful trio in Java programming: Collectors, Comparators, and Type Inferencing. In the ever-evolving landscape of Java development, mastering these essential components is paramount. This article delves into the nuances, applications, and optimization strategies associated with each, aiming to provide a resource that not only educates but empowers developers to harness the full potential of these features.

Collectors in Java: Transforming Data with Precision


Java Collectors are pivotal tools for data manipulation and transformation. Whether you're aggregating elements into a collection or computing statistical information, understanding the intricacies of Collectors is fundamental.

Streamlining Data Aggregation

Collectors.collectingAndThen: This powerful collector enables developers to perform a secondary transformation on the result, adding an extra layer of flexibility to data processing.

Collectors.groupingBy: Ideal for categorizing elements based on specific criteria, this collector simplifies the process of creating grouped representations of data.

Collectors.partitioningBy: When dealing with binary decisions, such as true or false conditions, this collector efficiently partitions data into distinct groups.

Comparators: Fine-Tuning Java's Sorting Mechanism


Sorting lies at the heart of many algorithms, and Java's Comparators play a crucial role in achieving efficient and customizable sorting mechanisms.

Natural Ordering with Comparable Interface

Java's Comparable interface provides a foundation for natural ordering within classes. Implementing this interface allows objects to define their own sorting logic.

Custom Sorting with Comparators

Comparator.comparing: This method facilitates sorting based on a specified key, offering a versatile approach to custom sorting.

Comparator.thenComparing: For scenarios where a single sorting criterion is insufficient, this method enables developers to chain multiple comparators, refining the sorting process.

Type Inferencing: Enhancing Code Readability and Flexibility


Java's type inferencing, introduced in Java 10, has revolutionized the way developers write code, bringing a balance between verbosity and precision.

Var Keyword: Concise Variable Declarations

The introduction of the var keyword allows developers to declare variables without explicitly stating the type. While maintaining strong typing, this feature enhances code readability and reduces redundancy.

Local Variable Type Inference: Embracing the "var" Paradigm

Java's commitment to enhancing developer experience is evident in the embrace of local variable type inference. By inferring types from the context, developers can write code more efficiently without sacrificing clarity.

Optimizing Java Development with the Power Trio


Now that we've unraveled the distinct capabilities of Collectors, Comparators, and Type Inferencing, let's explore how combining these features can lead to optimized Java development.

Efficient Data Processing Pipelines

By employing Collectors judiciously in conjunction with effective Comparators, developers can create streamlined data processing pipelines. This not only enhances the readability of code but also contributes to improved performance.

Enhanced Code Maintainability

Type inferencing, when integrated seamlessly with Collectors and Comparators, contributes to enhanced code maintainability. The reduction of boilerplate code allows developers to focus on the core logic, resulting in more robust and manageable codebases.

Conclusion: Empowering Java Developers to New Heights

In conclusion, mastering the art of Collectors, Comparators, and Type Inferencing in Java is pivotal for any developer aspiring to excel in the ever-evolving world of software development. The synergy of these features opens doors to unparalleled efficiency, readability, and maintainability.

Thursday, January 11, 2024

Unleashing the Power of Oracle GraalVM for JDK 21

Introduction


In the ever-evolving landscape of Java Development, staying ahead of the curve is not just a choice; it's a necessity. The advent of JDK 21 brings forth a technological marvel, and we, at Oracle Java Certifed, are excited to guide you through the immense capabilities of Oracle GraalVM, propelling your Java applications to new heights.

Understanding Oracle GraalVM


What sets GraalVM Apart?

Oracle GraalVM, often hailed as the secret weapon for developers, is a high-performance runtime that supports various languages, including Java, JavaScript, Python, Ruby, and more. What distinguishes GraalVM is its ability to provide unmatched speed and efficiency, transcending the limitations of conventional Java Development Kits.

Unleashing the Power of Oracle GraalVM for JDK 21

Key Features of Oracle GraalVM

1. Polyglot Programming: Embrace a polyglot approach, enabling seamless integration of multiple languages within the same application.

2. Ahead-of-Time Compilation (AOT): Boost your application's startup time and overall performance with GraalVM's AOT compilation, a game-changer for resource-intensive applications.

3. Native Image Support: Transform your Java applications into standalone executables with GraalVM's native image support, reducing memory footprint and enhancing deployment flexibility.

4. Extended Ecosystem Compatibility: GraalVM ensures compatibility with a vast ecosystem of libraries and frameworks, allowing developers to leverage existing tools effortlessly.

Harnessing the Power of JDK 21


Unveiling JDK 21 Features

Record Types Revolutionize Data Handling

In JDK 21, the introduction of record types signifies a paradigm shift in how developers handle data. With a concise syntax and automatic generation of methods like toString(), equals(), and hashCode(), record types enhance code readability and reduce boilerplate.

Pattern Matching for Switch Statements

JDK 21 introduces enhanced pattern matching for switch statements, simplifying code structures and making it more expressive. This feature streamlines the process of writing clear and concise code for complex scenarios.

Oracle GraalVM and JDK 21 Synergy

Performance Boost with Just-In-Time Compilation

The seamless integration of Oracle GraalVM with JDK 21 brings forth a synergy that developers dream of. The combination of GraalVM's Just-In-Time Compilation and JDK 21's powerful features results in unparalleled performance gains for your Java applications.

Polyglot Possibilities in Action

Imagine a scenario where your application seamlessly incorporates Java, JavaScript, and Python components. Oracle GraalVM, coupled with JDK 21, makes this a reality, opening the door to a world of polyglot possibilities that were once considered complex and challenging.

Implementation Best Practices


Incorporating Oracle GraalVM and JDK 21 in Your Project

1. Evaluate Compatibility: Before migration, assess the compatibility of your existing codebase with Oracle GraalVM and JDK 21 to ensure a smooth transition.

2. Optimize for Native Image: Leverage GraalVM's native image support by optimizing your application for better performance and reduced resource consumption.

3. Explore Polyglot Scenarios: Identify areas in your project where a polyglot approach could enhance functionality, and leverage GraalVM's capabilities accordingly.

Conclusion

In conclusion, Oracle GraalVM for JDK 21 is not just an upgrade; it's a leap into the future of Java development. The powerful features of JDK 21, coupled with the unmatched capabilities of Oracle GraalVM, position your applications for success in an increasingly competitive landscape.

Monday, January 8, 2024

Java Card 3.1: Cryptographic Extensions

Java Card 3.1: Cryptographic Extensions

A security product is not necessarily a cryptographic product. However since security products often involve the protection and processing of sensitive data, they typically imply the use and management of cryptographic materials. Java Card offers cryptographic packages to handle keys as trusted objects, and to support state-of-the art algorithms and related operations.

The features described in this blog entry are new cryptographic extensions to the Java Card framework. In Java Card 3.1, they have been added to the following two packages:

1. javacard.security defines the core security and cryptography framework. It includes KeyBuilder and KeyPair classes to generate and build various types of keys and algorithms for symmetric (e.g. AES) and asymmetric (e.g. RSA, ECC, DH,…) algorithms. Operations such as random number generation, message digests calculation, signature generation and verification and key agreement are covered by dedicated classes in this package.

2. javacardx.crypto is an extension package that contains optional functionality for implementing a security and cryptography framework on the Java Card platform. This optional package is supported when cryptographic encryption and decryption functionality is included in the implementation. It contains the Cipher class and KeyEncryption interface. Cipher provides methods for encrypting and decrypting messages. KeyEncryption provides functionality that allows keys to be updated in a secure end-to-end fashion.

The Java Card 3.1 release offers the following extensions to the javacard.security and javacardx.crypto packages:

Configurable Key Pair generation Support


The API Class javacard.security.KeyPair is extended to provide means for an application to control some parameters of the asymmetric key pair generation. This helps algorithms requiring prime numbers to set up the primality test, for example Fermat or Miller-Rabin. In particular, it permits the configuration of a random number generator algorithm including the seed to be used. This last point is critical to be able to generate a key pair in a deterministic way from a known secret.

Asymmetric cryptography is critical to mutual authentication. It generally implies a client and a server, equipped with key pairs and certificates. Because of the nature and scale of the IoT market, provisioning IoT devices with such cryptographic material takes time and implies costs at manufacture. It usually binds the device to a single IoT cloud service (to which the device will be attached).

To avoid such inconvenience, some solutions and protocols rely on the injection of a secret within the device at manufacture or later. This secret (or a secret derived from it) is shared with a cloud service. Once the device is deployed, a key pair can be generated in a deterministic way on both sides using the 

shared secret as a common seed. This offers a more flexible way to equip a device with the key material needed to perform authentication once in the field.

In Java Card 3.1, a new method KeyPair.genKeyPair(AlgorithmParameterSpec) is provided generate such keys is added,  supporting a configuration parameter object (implementing AlgorithmParameterSpec) provided by the application. In the case of the RSA algorithm for instance, it permits to configure:

◉ the parameters for primality test (like the type of test, or the number of rounds)

◉ the random number generation algorithm,  for example to deterministically generate the key from a secret

Named Elliptic Curves Support


Asymmetric cryptography based on Elliptic Curves Cryptography (ECC) is widely used. One reason of this success is the reduced processing time and low power consumption to compute encryption or signature operations - compared to RSA or DSA algorithms for instance. These characteristics make Elliptic Curves a critical requirement for low-end IoT devices.

In most of current cryptographic APIs - including the Java Card API - an ECC key is associated with a curve and its domain parameters. It offers a flexible way to match any variant of domain parameters, but implies additional management (to pass domain parameters to a key object) and memory consumption mechanisms. Furthermore, for interoperability and security reasons, standard bodies like NIST generate and publish domain parameters for common field sizes. Such domain parameters are known as "named curves" and can be directly referenced by their name. This mechanism allows a more efficient memory management, critical for IoT needs.

In Java Card 3.1, the ECC API in the javacard.security package is extended to support a set of named parameters, allowing an application to refer to these pre-defined parameters both to create and use keys, without the need to configure corresponding key parameters:

◉ a new buildXECKey method is added to the class KeyBuilder to create EC keys for named curves

◉ XECKey, XECPublicKey and XECPrivateKey interfaces permits to handle related keys

◉ NamedParameterSpec class provides a list of named curves. It includes new curves such as Edward 25519 & 448 named curves (see below for the complete list) for instance.

New Algorithms and Operations Support


Additional Elliptic Curves

Java Card 3.1 adds support to several named curves and related key agreement, signature and encryption operations:

  • X25519 and X448 named curves and key agreement operation as specified in RFC 7748. It defines a key agreement scheme that is more efficient and secure than the existing ECDH scheme, and that is also used in TLS1.3
    • The Named Curves mechanism is extended with X25519 and X448 which both allow to create the corresponding EC keys to be used with a KeyAgreement object instance.
    • The KeyAgreement class is also extended to support this key agreement scheme.
  • ED25519 and ED448 named curves and related signature operation, the Edwards-Curve Digital Signature Algorithm (EdDSA),  as specified in RFC 8032
    • The Named Curves mechanism is extended with ED25519 and ED448 which both allow to create the corresponding EC keys to be used with a Signature object instance.
    • The Signature class is also extended to support EdDSA in pure mode or pre-hash mode.
  • FRP256v1 named curve which can be used for signature and key agreement operations
    • The Named Curves mechanism is extended with FRP256v1 which allows to create the corresponding EC key.
    • Signature class and KeyAgreement class are extended to support related operations.
  • SM2 Chinese named curve which can be used for signature, key agreement and public key encryption operations
    • The Named Curves mechanism is extended with SM2 which allows to create the corresponding EC key.
    • Signature class, Cipher class and KeyAgreement class are extended to support related operations.
  • For curves that already had a counter part on the original EC API (with domain parameters), a named curve variant (without domain parameters) is now available for common field sizes. It concerns Brainpool and Secp curves: 
    • brainpoolp192r1, brainpoolp224r1, brainpoolp256r1, brainpoolp320r1, brainpoolp384r1, brainpoolp512r1
    • brainpoolp192t1, brainpoolp224t1, brainpoolp256t1, brainpoolp320t1, brainpoolp384t1, brainpoolp512t1
    • secp192r1, secp224r1, secp256r1, secp384r1, secp521r1

Additional AES modes (CFB & XTS)

Java Card 3.1 API for ciphering (javacardx.crypto.Cipher class) includes additional support to the following AES encryption modes:    

  • Cipher Feedback mode - AES-CFB mode, typically used for stream ciphering. 
  • XEX Tweakable Block Cipher with Ciphertext Stealing mode - AES-XTS mode, typically used for secure storage in external memory.

Chinese Algorithms (SM2 - SM3 - SM4)

In addition to the support of the Chinese SM2 named curve described above, Java Card 3.1 API includes also support to the following Chinese algorithms:

  • SM3 hashing algorithm: extension of the existing MessageDigest class
  • SM4 block cipher algorithm: extension of the Cipher class and new SM4 key type with corresponding interface
In Summary

Each release of the Java Card Platform brings updates to its cryptographic functionality. Inclusion of the latest algorithms and operations ensures that Java Card products and applications can offer interoperable state-of-the-art cryptography features. With the support of configurable Key Pair generation, Elliptic named curves keys and operations (e.g X25519, X448, ...), Chinese Algorithms (SM2, SM3, SM4) and two additional AES modes (CFB, XTS) the Java Card 3.1 release brings major enhancements to meet the security requirements of both existing secure chips and emerging IoT technologies.

Source: oracle.com

Friday, January 5, 2024

Unveiling the Power of Java Platform for Seamless Development

Unveiling the Power of Java Platform for Seamless Development

Introduction


In the ever-evolving realm of technology, the Java platform stands as an indomitable force, empowering developers and businesses alike. As we delve into the intricate tapestry of Java's capabilities, we unravel a world where innovation meets efficiency.

Understanding Java Platform


What Sets Java Apart?

Java isn't just a programming language; it's a robust platform renowned for its versatility and cross-platform compatibility. Unlike many counterparts, Java code can run on any device, making it an ideal choice for developers seeking a universal solution.

The Core of Java: JVM

At the heart of Java's prowess lies the Java Virtual Machine (JVM). This remarkable piece of technology translates Java bytecode into machine-specific code, ensuring that applications run seamlessly across diverse environments. The JVM acts as a linchpin, enabling the platform's "write once, run anywhere" paradigm.

Java Platform Components


1. Java Development Kit (JDK)

The JDK is the bedrock of Java development, providing a comprehensive set of tools for compiling, debugging, and executing Java code. Developers wield the JDK to transform their ideas into robust, functional applications.

2. Application Programming Interfaces (APIs)

Java's extensive collection of APIs serves as a treasure trove for developers. These pre-built libraries simplify complex tasks, accelerating the development process and enhancing code reliability. From graphical user interfaces to networking capabilities, Java's APIs are the backbone of countless applications.

3. Integrated Development Environments (IDEs)

Java developers benefit from a plethora of sophisticated IDEs, each tailored to streamline the coding experience. Whether it's Eclipse, IntelliJ IDEA, or NetBeans, these environments provide tools and features that foster productivity and code quality.

Java in Action: Real-world Applications


1. Enterprise-level Solutions

Java finds itself deeply ingrained in the fabric of enterprise solutions. From large-scale banking systems to e-commerce platforms, its scalability and reliability make it a preferred choice for businesses seeking stability and performance.

2. Mobile App Development

In the dynamic world of mobile applications, Java continues to shine. Android, the leading mobile operating system, relies heavily on Java for app development. The Android SDK, built on Java, empowers developers to craft engaging and functional mobile experiences.

3. Web Development

Java's influence extends seamlessly into web development. Frameworks like Spring and Struts leverage Java's capabilities to create robust and scalable web applications. The platform's ability to handle concurrent users and manage heavy workloads makes it an ideal choice for mission-critical web solutions.

Future Trends and Innovations


As technology advances, so does Java. The platform constantly evolves to meet the demands of modern development. With the advent of modularization in Java 9, developers can now create more modular, maintainable, and scalable applications.

Conclusion

In the intricate dance of programming languages, the Java platform emerges as a timeless partner for developers worldwide. Its versatility, reliability, and cross-platform compatibility make it a beacon in the vast sea of programming options.

Wednesday, January 3, 2024

Announcing GraalVM Enterprise in OCI Code Editor and Cloud Shell

Today, we are announcing that you can use GraalVM Enterprise directly in Oracle Cloud Infrastructure (OCI) Code Editor and Cloud Shell, at no additional cost. This means you can now edit and deploy high-performance Java, Spring Boot, and Micronaut application code from a browser, without any installation and configuration.

Announcing GraalVM Enterprise in OCI Code Editor and Cloud Shell

GraalVM is a high-performance JDK distribution that accelerates Java workloads. GraalVM Native Image ahead-of-time compilation builds your Java application into a native executable that is small, starts fast, and uses less memory and CPU. Leading Java microservices frameworks such as Spring Boot, Micronaut, Quarkus and Helidon support GraalVM Native Image.

Code Editor enables you to edit and deploy code directly from the Oracle Cloud Console. You can develop applications, service workflows, and scripts entirely from a browser. This makes it easy to rapidly prototype cloud solutions, try new services, and accomplish quick coding tasks.

Cloud Shell is a free-to-use browser-based terminal accessible from the Oracle Cloud Console. It provides access to a Linux shell with preinstalled developer tools and a pre-authenticated OCI CLI. You can use the shell to interact with OCI resources, follow labs and tutorials, and quickly run utility commands.

Using GraalVM Enterprise in Code Editor and Cloud Shell


GraalVM Enterprise JDK 17 and Native Image are now preinstalled in Cloud Shell, so you don’t have to install and configure a development machine. Code Editor's integration with Cloud Shell gives you direct access to GraalVM Enterprise JDK 17 and Native Image.

Simply login to the Oracle Cloud Console and launch Code Editor (or Cloud Shell). From the Code Editor (or Cloud Shell) terminal window, select GraalVM as your JDK by running the following command:

csruntimectl java set graalvmeejdk-17

Now you are all set to use GraalVM Enterprise JDK 17 and Native Image for your Java, Spring Boot, Micronaut, Helidon, and Quarkus applications. You can use the GraalVM Maven and Gradle plugins to build and package your application as a native executable or JAR file.

Announcing GraalVM Enterprise in OCI Code Editor and Cloud Shell

Source: oracle.com

Monday, January 1, 2024

Quiz yourself: Serializing a primitive with ObjectOutputStream

Quiz yourself: Serializing a primitive with ObjectOutputStream

Primitives? Objects? What should you do?


You need to serialize a long primitive value, and you have been given the following code:

long l = 5L;
try (ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(filename))) {
  ... //
}

Which statement is true? Choose one.

A. The code must box the primitive using oos.writeObject(Long.valueOf(l)).
B. The primitive must be included in the outer Java class as an instance variable to be serialized.
C. The serialization should be implemented as oos.writeObject(l).
D. The serialization should be implemented as oos.writeLong(l).
E. The serialization must delegate to the DataOutput class for writing primitives.

Answer. Java serialization provides a way to represent a graph of objects as a byte sequence. This mechanism also supports primitive data directly, as part of objects. Primitive wrapper classes also implement the Serializable interface and can be serialized too. Commonly, the byte sequence that results from serialization is written to disk for long-term storage or is transmitted across a network.

In most cases, you will use the class ObjectOutputStream to create the serialized byte stream. This class provides the writeObject method proposed in option C, and that method readily handles serializing an entire graph of objects. The result can be transparently restored using the ObjectInputStream class. Note, however, that the argument to the writeObject method is an object, not a primitive.

The previous discussion tells you something about option C: If it’s used, autoboxing would occur and you would not serialize the primitive value. Instead, you would have a serialized representation of the wrapper that was created. At this point in analyzing the exam question, it’s probably too early to reject this option, but you must decide whether any other answer is a better match with the proposition of the question—which does, after all, specifically mention that you are serializing a primitive value.

It turns out that ObjectOutputStream implements the java.io.DataOutput interface. That interface defines writeXXX methods for all primitives. As a side note, DataOutput is also implemented by the class java.io.DataOutputStream, but although that class works with primitives and strings, it cannot perform serialization. This capability is described in option D, and it will allow you to use the oos object to serialize the primitive directly. From this you can determine that option D is correct. It’s definitely better than option C, and you can now confidently reject option C as incorrect.

Although you should feel confident in the correctness of option D, you should still verify that the other options are incorrect. In an exam, you might discover another option that seems correct, which would cause you to revisit your reasoning. But if you’re tight on time, you might go with the first answer that appears correct.

Option A is incorrect: The ObjectOutputStream is able to serialize primitives directly, which means that boxing is not necessary. Of course, if your application calls for it, you can box or autobox the primitive, but it’s not necessary. Further, the result will take substantially more space in the resulting byte sequence.

Option B is also incorrect for essentially for the same reason as with options A and C. Certainly primitives that are members of objects are handled correctly, but it’s not necessary to wrap a primitive in such an object just to get it out into the byte sequence.

Option E is incorrect, because, as discussed earlier, java.io.DataOutput is an interface, not a class, as is suggested in the stem. The interface declares the signatures of various methods, including the writeLong method you will use, but writeLong is (and, in fact, all the methods of this interface are) abstract. The implementation is provided by the java.io.ObjectOutputStream class; therefore, delegation in the code is not necessary or possible.

Conclusion. The correct answer is option D.

Source: oracle.com