How to replace Java Security Manager

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.

Read more

Monitoring File System Events with Java.nio.file.WatchService

The java.nio.file package provides the WatchService API for monitoring changes to the file system. This tutorial will guide you through using WatchService to detect events like file creation, modification, and deletion.


  • Basic understanding of Java programming
  • Familiarity with working with files and directories

Read more

Solving java.lang.OutOfMemoryError: Metaspace error

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 analyze the issue, determine the root cause of it and take actions to resolve it.

Read more

Maven is using the wrong version: Explained

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.

Read more

How to use Hidden Classes in Java

Hidden classes ( available since Java 15 ) allow developers to define classes that cannot be directly accessed by other classes in the same program. These classes are designed for use by frameworks that generate classes at runtime without using the standard classloading mechanism. Purpose of Java Hidden Classes Hidden classes can enable frameworks to … Read more

Modern Java Pocket Guide available

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! 🚀

Read more

Java Structured Concurrency in practice

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.

Read more

JBang Cheatsheet (2024) for Java Developers

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.

Read more

Setting Maximum Memory Size in Java Applications

The heap size of Java applications significantly impacts memory utilization and, consequently, performance aspects such as garbage collection cycles and compressed pointers. Tuning the heap size becomes crucial, particularly when deploying applications within containers or across various hosts. Heap Size Calculations: The -Xmx and -Xms flags control the maximum and initial heap sizes, respectively. However, … Read more