If you encounter javax.net.ssl.SSLHandshakeException while developing or deploying Java applications on WildFly, Spring Boot, Quarkus, or microservices, it often indicates a mismatch between your client and server TLS configurations. This exception can result from expired certificates, missing trusted CA certificates, or unsupported TLS versions (TLS 1.0/1.1 being deprecated) in your JVM or server configuration. In this updated guide, you will learn practical, step-by-step methods to diagnose and solve SSLHandshakeException in Java, ensuring your applications remain secure and compliant with modern TLS 1.2 and TLS 1.3 standards while maintaining connectivity to HTTPS endpoints.
The error java.lang.OutOfMemoryError:Metaspace indicates that you have exhausted an area of JVM which serves as a registry for your application’s Class Metadata. This article is a step-by-step guide to fix Java Metaspace errors with Java 17’s elastic metaspace (JEP 387), diagnostic tools like jcmd, and best practices for JVM configuration.
JBang is a scripting tool which allows to run Java application with minimal set up, without the need of having a project configuration. In this tutorial we will learn how to use it to run a simple Java application and then we will be looking at a more complex example, which starts a Quarkus application.
This step-by-step guide will show you how to create a minimal Java LDAP Client to test the connection to an LDAP Server and show the LDAP tree using a graphical interface. We will use Docker to trigger a simple LDAP Server so you don’t need to install anything!
MapStruct is a powerful Java annotation processor that simplifies the mapping between Java bean types. In this advanced tutorial, we will explore several advanced features of MapStruct, such as mapping from multiple sources to a target object, using Java expressions in mappings and much more!
JSONPath is a powerful tool for querying JSON data, similar to XPath for XML. Combining JSONPath with Jackson, a popular Java library for JSON processing, allows for advanced mapping of JSON structures to Java objects. This tutorial demonstrates how to map JSONPath expressions using Jackson and Jayway JsonPath.
In this tutorial, we will explore how to convert a PDF document into raw text using the Apache PDFBox library in Java. This process can be particularly useful for applications that need to analyze or summarize the contents of a PDF, such as providing input to an AI chatbot.
Prerequisites:
The Java SecurityManager, a veteran of the platform since JDK 1.0, has been officially deprecated for removal. Besides, Jakarta EE 11 removes support for running with a SecurityManager. This article explores the reasons behind this decision and the future of application security in Java.
In this short wiki we will learn how to use the Figlet API to generate an AsciiArt Banners in Java applications. We will also show how to emed a sample example in a JBang Script.
In this article we will go through a common issue that you can face when compiling and running applications with Maven. The syntom of this issue is that Maven is using the wrong version during the execution. We will show the cause of the issue and the remediation.
Calling all Java enthusiasts! I’m excited to share that my latest tiny ebook is now live—a concise reference guide covering all the top features in Java from version 8 to the upcoming version 22! 🚀
Lombok is a popular Java library that aims to reduce boilerplate code by providing annotations that generate getters, setters, constructors, and other commonly used methods automatically during the compilation process. In this tutorial we will learn how to use it and which are the pros and cons of this library.
Structured concurrency (JEP 453) is a method of organizing concurrent programming in a way that maintains the relationship between tasks and subtasks. This approach aims to make concurrent code more readable, maintainable, and reliable. In structured concurrency, tasks and their subtasks have well-defined entry and exit points. This creates a clear structure similar to how structured programming works in a single thread.
Welcome to the JBang Cheatsheet, your comprehensive guide to mastering this powerful tool for rapid Java development. JBang eliminates the need for complex setup and repetitive configuration, allowing you to focus on writing code and exploring new Java projects. Whether you’re a seasoned Java developer or just starting out, this cheatsheet will equip you with the knowledge and skills to leverage JBang‘s capabilities and accelerate your Java development journey.
In Java, working with collections like lists is fundamental. Often, you’ll need to convert objects or records into lists for various purposes. In this tutorial, we’ll explore different approaches to create a List from a property of an Array of Java objects or Records using practical examples.
Java 17 is soon becoming the minimal JDK version for top frameworks such Spring Boot. Selecting the right OpenJDK 17 image for your projects is crucial. This tutorial aims to introduce and test various OpenJDK 17 images available, providing insights into their features and performance.
When working with Java, it’s often necessary to convert data structures to and from different formats, especially when dealing with JSON data. Fortunately, libraries like Jackson provide robust support for JSON processing, allowing seamless conversion between Java objects and JSON representations. In this article, we’ll explore how to convert a Map to a JSON object using Jackson in Java.
Java KeyStores (JKS) provide a secure way to store sensitive data, and they can be used by Java applications to encrypt and decrypt data, authenticate users, and secure network communications. In this tutorial we will check three ways to read the content of a KeyStore information such as the alias the the Certificate.
The EnumMap and EnumSet are specialized implementations in Java that are optimized for working with Enum keys and Enum values, respectively. In this article we will learn how to use them and which are the common use cases. Finally, we will also highlight the differences with the standard Map and Set objects.
To troubleshoot a Java application it is common to analyze both Heap Dumps and Thread Dumps. In this article we will learn how to extract a Thread dump from an Heap Dump with some freely available tools like VisualVM.
The java.net.SocketException Connection reset is a common Runtime error within Java applications. This tutorial delves into its occurrences, diagnostic steps, and effective solutions.
Virtual threads, also known as project Loom, are a new feature available in Java 21 that aims to provide lightweight, efficient, and scalable concurrency. They are designed to improve the performance and efficiency of concurrent applications by reducing the overhead associated with traditional thread-based concurrency. At the same time, they allow write asynchronous code in a much simpler way than reactive programming.
This article will guide you in troubleshooting Java application by analysing a Thread dump with the instruments available in the JDK. We will also learn some tools to simplify our analysis.
One critical tool in diagnosing memory-related issues is the Heap dump, a snapshot of an application’s memory at a particular point in time. However, as applications become larger and more intricate, heap dumps can also become massive and challenging to analyze. In this article, we will learn how to examine Heap Dump data even with lightly equipped hardware.
Java 21 introduces two language core features: Unnamed Java Classes and a new launch protocol which allows running Java classes in a simpler format. In this article we will cover in detail these new features explaining how they can simplify your daily Java coding.
This article shows how to fix the compilation issue that you can hit when the target Java release specified in your Maven configuration does not match the version of Java installed on your system. For example, your environment uses Java 11 but your Maven configuration requires Java 17.
If you’re a developer who has worked with web APIs, you might have come across the HTTP 415 “Unsupported Media Type” error. This error occurs when the server doesn’t support the media type that’s being used in the request. In this tutorial, we’ll discuss one common cause of the HTTP 415 error and how to fix it.
When working with Java, it’s common to encounter situations where you need to handle multiple exceptions. Fortunately, Java provides a simple and efficient way to do this using the catch block. In this tutorial, we’ll explore how to catch multiple exceptions in Java, along with some tips and code snippets to help you get started.
The finally block in Java is used to define a section of code that will always be executed, regardless of whether an exception is thrown or caught. However, there are certain conditions under which the finally block may not execute. In this tutorial, we’ll explore these conditions and provide some code snippets to illustrate them. Hint: read it through as this is a common interview question!
The Java 11 HttpClient API provides a lot of configuration options that you can use to tune its performance. In this tutorial, we will explore some of the most important ones.
Using Java as scripting language has become a popular option in the last few years thanks to the JShell tool. In this article we will learn how the JBang scripting tool can take your Java scripting power at another level.
Listing the available artifacts in your Maven local repository generally requires a Maven project. In this article we will show how to create a simple JBang script to list all dependencies for an artifact in your local Maven repository.
Are you going for a Java Interview ? This article contains a list of Interview Questions which are covering modern aspects of Java, such as Functional programming, Stream API, new IO API and much more.
This article goes through the most common Java OutOfMemory Error, which happens when you saturate the Java Heap Memory. Within this article we will show how to fix this error depending if you are an application user or an application developer.
In this tutorial, we will learn how to capture a thread dump in Java using different methods depending on the operating system and the environment in which the Java application is running.
This article is an introduction to gRPC framework which allows to connect services across data centers using high performance Remote Procedure Calls (RPC). To learn the building blocks of this framework, we will show how to create and test your first gRPC application in Java.
This article discusses which are the best strategies to tune a Linux machine where you are running Java applications. We will first cover the best tools you can use for your analysis and then we will pinpoint the single OS aspects.
This article will introduce you to SpotBugs utility project that can assist you to spot Java “bug patterns” in your code which are likely to turn into runtime bugs.
This article is whirlwind tour across the Java Flight Recorder (JFR) and the Java Mission Control (JMC) suite. At the end of it, you will be able to monitor, collect diagnostic data and profile any running Java application.
This article is a whirlwind tour of AtlasMap Data transformation API and User Interface. We will learn how to use its editor to define mapping rules and how to use them in a sample Java Integration project.
This article continues our learning through the Java Mission Control (JMC) tool. Within it, we will learn how to run JMC as standalone application or as Eclipse IDE plugin.
This quick article shows how to install and use JBang’s IntelliJ Idea plugin to create JBang projects and scripts in no time.
In this brief article we will outline three JVM configuration parameters you can add to the JVM to handle a scenario when your application issues an OutOfMemoryError.
Java 18 is finally available for download! In this article we will learn some of the most interesting Enhancement Proposals (JEPs) which are now available in the JDK.
In this post I will keep some useful Java hacks and one-liners which are useful in every day programming
This is the second tutorial about JBang. In the first one we covered the basics of this powerful scripting toolkit: Java scripting with JBang . We will now learn how to install Apps from its rich catalog and how to run scripts on the top of Apps.