dev.java
learn.java
Information: Java Magazine, DZone, JCP, Jenkov.com, Baeldung
Freeware: Kaffe🏚️
archive
JDK docs: 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24
javadoc: Documentation Comment Specification, personal notes
Maven
Heapdump analyzers: Memory Analyzer (MAT)↑, VisualVM, HeapAnalyzer
Obfuscators: Jshrink
FAQs: Angelika Langer’s Java Generics FAQs
Java Performance Tuning
Libraries
- Collections
- ORM
- DAL optimisation
- Java parsers
- Guava
- ND4J: N-Dimensional Arrays for Java
- jOOQ: SQL helper
- JNA: Java Native Access
- Ehcache: cache management
- jsoup: HTML parser
- Jersey: HTML parser
- OpenRewrite: Java/framework updates
Coding rules: Doug Leas🏚️, AmbySoft🏚️, Macadamian🏚️, Google, OpenJDK
personal notes
Articles and videos
- 2D animation with image-based paths — Take the heavy coding out of fixed-object animation↓🗑️ by and (January 9th, 2004) ► The paths of some sprites is recorded using some colour encoding. Not a big deal…
- Approaches to Mocking🗑️ by (February 2nd, 2004) ► An introduction on using mocks (aka stubs) in Java: static mocks, dynamic mocks, AOP.
- Java theory and practice: Coaxing J2EE out of the container — Projects like Somnifugi JMS blur the boundary between J2EE and J2SE🗑️ by (April 24th, 2004) ► The standalone implementation of some J2EE components (JMS, JNDI) and using JMX.
- Getting the Bugs Out: A Conversation With Bug Fixer Brian Harry🚫 by (April 2007) ► The interview of a guy who killed hundreds of bugs in the JDK.
- Developing iPhone Applications using Java by (October 15th, 2008) ► The technical solution described here is too simplistic: the performance would be awful, you have to reimplement Cocoa in Java…
- Project PlaySIM: Experimenting with Java Card™ 3 System Prog by and (June 5th, 2009) ► PlaySIM is a hardware prototyping platform: a daughter board for the SunSPOT platform is used to emulate a Java Card 3 SIM card.
- Seven ways to get things started. Java EE Startup Classes with GlassFish and WebLogic by (September 7th, 2010) ► How to perform some actions at the application startup or shutdown.
- 5 things you didn't know about … everyday Java tools — Java tools for everyday things, like parsing, timing, and sound🗑️ by (September 14th, 2010) ► Random stuff: StAX, ServiceLoader, Scanner, Timer, and JavaSound.
- Have Java's Security Issues Gotten out of Hand by (December 2012) ► Vulnerabilities are found over and over again in Oracle’s JVM.
- Transparent network acceleration for Java-based workloads in the cloud — Introducing the Java Sockets over RDMA library🗑️ by , , , , , and (January 28th, 2014) ► A presentation of JSOR, how to use it, and how much it improves socket performance.
- Build an application using microservices and CQRS — Maximize the performance and scalability of your microservices-based apps🚫 by (July 27th, 2016) ► Using Spring and Axon to implement an application having a CQRS architecture.
- JVM Anatomy Quark #8: Local Variable Reachability by (2017) ► Objects referenced in local variable may be collected before the end of the variable scope is reached.
- How to Convert CSV to JSON in Java — Convert CSV to JSON using Jackson. Use a POJO for conversion or a List & Map for intermediate storage. by (February 27th, 2017) ► The title says it all.
-
Deprecation of Object.finalize() by (April 17th, 2017) ►
Object.finalize()
is obsoleted, but not planned for removal yet. -
The State of Debugging in Java — Debugging has come a long way from the jdb days. Here, we cover the variety of Java debuggers out there and some common practices devs use. by (June 30th, 2017) ► A quick presentation of the tools that can be used to debug a system in production:
jps
,jinfo
,jcmd
,jmap
,jhat
,jstack
,jstat
,jdb
. - Some factory examples. by (December 13th, 2017) ► Creating a factory with plain Java, SPI, CDI and EJB.
- 20 Examples of Using Java’s CompletableFuture by (January 26th, 2018) ► A long list of simple examples with little explanation.
- Java on Arm processors: Understanding AArch64 vs. x86 by (September 2018) ► A description of the current Java support on ARMv8 and a small performance benchmark to compare with Intel.
- Using Java Flight Recorder With OpenJDK 11 — Want to learn how to use the Java Flight Recorder with OpenJDK 11? Check out this post to learn more about using the Java Flight Recorder and Java Mission Control. by (October 16th, 2018) ► A presentation of Java Flight Recorder, but the author does not seem to master all the details.
-
SafeVarargs & Variable arguments in Java by (December 21st, 2018) ► When to use
@SafeVarargs
. - Unit Test Your Architecture with ArchUnit — Discover architectural defects at build time. by (August 20th, 2019) ► A good overview of ArchUnit, a library to define some code rules and verify them as unit tests.
-
The Unsafe Class: Unsafe at Any Speed by (May 4th, 2020) ► The need for the features provided by
sun.misc.Unsafe
and how it is being replaced:MethodHandles
,VarHandle
, hidden classes, and the need for instantiating an object without calling its constructor. - Java – Read a file from resources folder by (September 4th, 2020) ► The title says it all.
-
Incompatibilities with JDK 15 CharSequence.isEmpty by (September 22nd, 2020) ► A description of some causes of source or binary incompatibilities and the particular case of
CharSequence.isEmpty()
. - How Java 15 taught me to love virtual hands-on labs — I worked through the three live hands-on labs that came with the latest Java release. You can, too.↓ by (October 7th, 2020) ► Some proselytism for Oracle hands on lab, but there is very little interesting information here.
-
A crash happened outside the Java Virtual Machine by (December 3rd, 2020) ► How to understand
hs_err
when a crash occurred in native code. - OracleDevLive Preview | Trisha Gee on Learning New Java 16 Features with IntelliJ IDEA by and (March 9th, 2021) ► IntelliJ IDEA release planning vs. Java release planning, learning by reading code, the Java community.
- Java still rocks the finance industry. Here’s why Java 16 makes it even better. — Java still rocks the finance industry. Here’s why Java 16 makes it even better. by (March 26th, 2021) ► Some little information about finance IT and the role of Java in it.
- Announcing Microsoft Build of OpenJDK by (April 6th, 2021) ► Microsoft is offering a distribution of OpenJDK.
- All our support agents are busy, please hold. by (April 21st, 2021) ► An advertisement for the service offer of Oracle: upgrade services, performance tuning services, and enterprise and third-party services.
- "Failed to write core dump" by (April 30th, 2021) ► How to configure the JVM to generate or not a core dump.
- Everything you need to know about OpenJDK’s move to Git and GitHub — The move from Mercurial to Git provided an opportunity to consolidate the source code repositories. by (May 15th, 2021) ► A short history of the revision control tools used for the JDK and how to build it today.
-
4 ready-to-try Java tools your team may not know about by (July 9th, 2021) ► A very short presentation of
jdeprscanv
,jlink
, JFR, andjpackage
. - Java is criminally underhyped — Recent computer science graduate Jackson Roberts never took a single class in Java. That’s just wrong, he says.↓ by (September 9th, 2021) ► Some Java proselytism bullshit.
- The art of long-term support and what LTS means for the Java ecosystem — Here’s what Java 17 has in common with Java 11 and Java 8. by (September 9th, 2021) ► Some information about Java LTS releases.
- Quiz yourself: Anonymous inner classes in Java by and (January 31st, 2022) ► The basics of anonymous classes.
- Bruce Eckel on Java interfaces and sealed classes — With the introduction of default and static methods in interfaces, Java lets you write method code in an interface that you might not want to be public.↓ by (April 25th, 2022) ► A description of interfaces and sealed class with little explanation.
- Quiz yourself: Declaring and accessing Java modules by and (May 27th, 2022) ► How to provide access to a module’s classes to classes outside that module.
- Design and document for inheritance—or else prohibit it. Here’s how.↑ by (July 29th, 2022) ► A good article about the possible problems when providing to others a class aimed to be inherited from.
- Curly Braces #6: Recursion and tail-call optimization by (November 7th, 2022) ► A description of tail-call optimisation and the fact that it is not supported by the JVM.
- Introducing the Visual Recognition spec for Java machine learning by , , , and (January 5th, 2023) ► JSR381 is a high-level API providing Java developers access to basic Machine Learning algorithms.
- Is this the future of Java? by (February 20th, 2023) ► A short and fast description of Manifold that adds a bunch of features to the language.
- 1, 2, 3 Quarkus! (Clement ESCOFFIER et Aurea MUNOZ HERNANDEZ) by and (April 14th, 2023) ► A demo of Quarkus 3.0.
- Quiz yourself: Collecting the Java garbage by and (May 1st, 2023) ► A vicious question.
- Quiz yourself: When is a Java object still reachable? by and (May 22nd, 2023) ► You need to remember that an instance of an inner class has a pointer toward its enclosing instance.
- Quiz yourself: How private is a Java private inner class? by and (May 29th, 2023) ► Is it possible to exploit an instance of a private inner class from outside?
-
Quiz yourself: Public and private classes and the Java Platform Module System by and (June 5th, 2023) ► Calling the
main
method of a class is not impacted by the module mechanism. -
Quiz yourself: Delegation using super(...) and this(...) during constructor execution by and (June 12th, 2023) ► The rules for calling
super()
orthis()
in a constructor. - Java's Startup Booster: CDS by (July 11th, 2023) ► The history of Java’s Class Data Sharing, why and how to use it.
- Quiz yourself: How Java resolves access to static elements in a type declaration by and (July 31st, 2023) ► Trying to understand the behaviour of messy code using shadowed method and field.
- Quiz yourself: Abstract classes and the difference between Java’s super() and this() by and (August 7th, 2023) ► The detailed mechanism of constructors.
- Quiz yourself: Using anonymous classes in Java by and (August 14th, 2023) ► An anonymous class having a method with package accessibility can only derive from a class, not from an interface.
- 97 Things Every Java Prog. Should Know • Trisha Gee & Kevlin Henney ft. Emily & Holly • GOTO 2024 by , , , and (October 4th, 2024) ► Some random pieces of advice for Java developers.
- Serialization 2.0 with Viktor Klang - Live Q&A at Devoxx BE by and (October 10th, 2024) ► The future of Java serialisation may be marshaling.
-
Detoxifying the JDK Source Code by (December 12th, 2024) ► The removal of the security manager allows the JDK code to be simplified by getting rid of all the
doPrivileged
calls. - A Deep Dive into JVM Start-Up by (January 9th, 2025) ► Some details on the different steps of the JVM startup.
- Compte Rendu du Paris JUG de Janvier 2025 by (January 20th, 2025) ► A summary of the JUG talks: Quarkus Cucumber, Camunda (a process orchestration platform), testing asynchronous code, the Java modules, a Globs (representing objects as maps) framework, and doing TDD with GitHub Copilot.
-
Tutorials
- Speaking the Java language without an accent — Native fluency for nonnative programmers🗑️ by (January 12th, 2010) ► Some coding habits that C/C++ developers should modify in order to code in Java as everyone else.
-
Javac and Java Katas, Part 1: Class Path — This article contains several exercises focused on using JDK tools such as javac, java, and jar to build and run Java applications. by (May 2nd, 2024) ► The basics of
javac
,jar
, andjava
.
-
Coding
- Seven Low-Cost Ways to Improve Legacy Code🗑️ by (April 28th, 2004) ► Some simple Java coding rules to improve code maintenance.
-
For the Fun of It: Writing Your Own Text Editor, Part 1 — Using a layered design and iterative development, a line editor evolves into a text editor in this new article series. by (August 20th, 2019) ► Some design details about a simple Java reimplementation of
ed
. - ↪For the Fun of It: Writing Your Own Text Editor, Part 2 — Using Swing to write a GUI for the text editor by (November 21st, 2019) ► The continuation of the previous article: creating a UI with Swing and testing.
- The joy of writing command-line utilities, Part 1: Finding duplicate files — Step-by-step creation of a small project that has practical utility by (August 14th, 2020) ► The writing of a small application and an analysis of the taken small decisions.
- ↪The joy of writing command-line utilities, Part 2: The souped-up way to find duplicate files — The brute-force method works—but a smarter algorithm improves performance by an order of magnitude. by (September 27th, 2020) ► The continuation of the previous article.
-
Performance
- The Java HotSpot Performance Engine: An In-Depth Look🚫 by (June 1999) ► This describes the new technologies used by the HotSpot VM: adaptative compilation, inlining, garbage collection…
- Java optimization techniques — A practical guide for squeezing every drop of performance out of your Java apps by and (June 2002) ► This is obvious, but too often forgotten: before implementing low-level optimisation, first check that your algorithm is not stupid.
- Java theory and practice, Performance management -- do you have a plan? — Knowing when to optimize is more important than knowing how to optimize🗑️ by (March 25th, 2003) ► The usual advice: performance must be managed as part of the development process.
-
Java performance monitoring, Part 1 — Java performance profiling with JConsole and VisualVM🗑️ by (March 25th, 2003) ► A very basic introduction to
JConsole
. -
↪5 things you didn't know about … Java performance monitoring, Part 2 — Java process monitoring with the JDK's built-in profilers🗑️ by (August 13th, 2010) ►
jps
,jstat
,jstack
,jmap
, andjhat
. - Java theory and practice: Urban performance legends — Alligators in the garbage collector and other programming myths🗑️ by (April 22nd, 2003) ► Some wrong ideas about JVM speed (synchronisation and immutable classes are slow, final classes are fast) and some good general advice about performance.
- Eye on performance: Micro performance benchmarking — Byte offers a glimpse into application performance🚫 by and (December 5th, 2003) ► Instead of performing oversimplified flawed performance tests, looking at the generated bytecodes can sometimes reveal the pointlessness of some Java code tuning.
- Java theory and practice: Garbage collection and performance — Hints, tips, and myths about writing garbage collection-friendly classes🗑️ by (January 27th, 2004) ► Some old tricks to avoid the impact of garbage collection on performance have nowadays adverse effects.
- Eye on performance: Tuning garbage collection in the HotSpot JVM — Packing 100 megabytes of garbage into a 50 megabyte bag🗑️ by and (June 30th, 2004) ► Tuning the garbage collector to lower its impact on performance.
- Faster problem solving in Java with heuristic search — Learn about a Java implementation of a popular search algorithm for artificial intelligence🗑️ by , , and (July 16th, 2013) ► A description of A*, a heuristic search algorithm, in Java and its optimisation by reducing memory consumption, using High Performance Primitive Collections, and recycling objects to avoid garbage collection.
- Introduction to Java VisualVM (December 3rd, 2013) ► The title says it all.
- Java Performance Optimization Tips: How to Avoid Common Pitfalls — Since Java is one of the most widely used languages in development today, learning how to make your Java apps as performant as possible is a crucial skill. by (October 11th, 2017) ► A short list of basic good pieces of advice.
- Processing Large Files in Java by (January 11th, 2019) ► The author describes some optimisations he did on a program parsing a big file.
- A Guide to Java Profilers (May 11th, 2024) ► A short presentation of JProfiler, YourKit, Java VisualVM, and NetBeans Profiler.
- Java Performance Update (January 25th, 2025) ► This presentation describes some JVM performance improvements, most of them are the same than 30 years ago. Only the last part, about the latest optimisations, is interesting.
-
Memory management
- Java theory and practice: Whose object is it, anyway? — Garbage collection reduces the need to track object ownership -- but it doesn't eliminate it🗑️ by (June 24th, 2003) ► Use immutable objects or defensive copying, otherwise you will have to clearly document which classes own the objects to avoid tricky bugs.
- Eye on performance: Referencing objects — How you reference objects can seriously affect the garbage collector🗑️ by and (August 26th, 2003) ► The authors explain how to fix unintentional object reference retention and that nulling reference is the wrong solution to a scoping problem.
- Java theory and practice: A brief history of garbage collection — How does garbage collection work?🗑️ by (October 28th, 2003) ► A short and clear description of the evolution of the garbage collection algorithms.
- Java theory and practice: Garbage collection in the HotSpot JVM — Generational and concurrent garbage collection🗑️ by (November 25th, 2003) ► The article describes the garbage collection algorithms implemented in 1.4 and what are their available tuning parameters.
- Thanks for the memory — Understanding how the JVM uses native memory on Windows and Linux🗑️ by (April 21st, 2009) ► After describing how the JVM is using native memory, explains how to find what is eating it up and locating leaks.
- The Essence of Caching - Ehcache↓ by (January 24th, 2011) ► Some general common information on caching and a presentation of Ehcache, an open source Java distributed cache.
- From Java code to Java heap — Understanding and optimizing your application's memory usage🚫 by (February 29th, 2012) ► A detailed analysis of the memory used for storing an object, an array, or a collection.
- Understanding the JDK’s New Superfast Garbage Collectors — ZGC, Shenandoah, and improvements to G1 get developers closer than ever to pauseless Java. by and (November 21st, 2019) ► Some information about Shenandoah, ZGC, and G1 improvements.
- Avoid Java Out of Memory in Kubernetes by (July 27th, 2023) ► describes how he configures the JVM memory in a Kubernetes pod.
- An Introduction to ZGC: A Scalable and Experimental Low-Latency JVM Garbage Collector by (January 8th, 2024) ► A short description of the Z Garbage Collector.
- Native Memory Tracking in JVM by (January 8th, 2024) ► A clear description of the different memory allocations and to use Native Memory Tracking (NMT).
-
Difference Between Xmx and MaxRAM JVM Parameters by (June 20th, 2024) ► A description of
-XX:MaxRAM
,-XX:MinRAMPercentage
, and-XX:MaxRAMPercentage
. -
References
-
Java Tip 79: Interact with garbage collector to avoid memory leaks — Use reference objects to prevent memory leaks in applications built on the MVC pattern by (October 20th, 1999) ► Using
WeakReference
s to record listeners and aReferenceQueue
to remove them. -
Guidelines for using the Java 2 reference classes — Learn to effectively use SoftReference, WeakReference, and PhantomReference🗑️ by (October 2002) ► An introduction to
SoftReference
,WeakReference
andPhantomReference
. -
Java theory and practice: Plugging memory leaks with weak references — Weak references make it easy to express object lifecycle relationships🗑️ by (November 22nd, 2005) ► An introduction to
WeakReference
and toWeakHashMap
to store metadata about objects only for as long as they are effectively used. -
Java theory and practice: Plugging memory leaks with soft references — Soft references provide for quick-and-dirty caching🗑️ by (February 24th, 2006) ► Using
SoftReference
s to implement a simple cache whose memory will be reclaimed if the JVM needs memory.
-
Java Tip 79: Interact with garbage collector to avoid memory leaks — Use reference objects to prevent memory leaks in applications built on the MVC pattern by (October 20th, 1999) ► Using
-
Memory leaks
- Bitter Java - Chapter 6: Bitter Memories🚫 by (May 2002) ► An introduction to Java memory leaks (unintentional object retention) and how to find and fix them.
- Memory Leaks, Be Gone by (June 27th, 2005) ► Some advertisement for the JRockit Memory Leak Detector.
- How to Fix Memory Leaks in Java by (March 18th, 2009) ► A good tutorial on how to analyse memory leaks.
-
JVM
- Java shared classes — Learn how to start your Java applications faster and with a smaller memory footprint🗑️ by , , and (June 8th, 2004) ► Sharing classes between JVMs in order to reduce memory usage and startup time.
- Taming Tiger: Virtual machine updates — Changes designed to speed startup time and reduce memory requirements🗑️ by (March 15th, 2005) ► New command line options allow to handle JVM crashes, switching on Java Shared Archives and there are the usual garbage collector and thread scheduling changes…
- Project Guest VM - A Java Platform implemented in Java and hosted on the Xen Hypervisor by (January 20th, 2009) ► Using Maxine VM, a virtual machine written in Java, directly on top of Xen in order to get rid of the OS layer.
-
Command-line flags for the JVM — Fine-tune JVM performance and the Java runtime🚫 by (August 24th, 2010) ► Some JVM flags:
-XX:+DisableExplicitGC
,-XX:+HeapDumpOnOutOfMemoryError
,-Xbootclasspath
,-verbose
, and-X
. - A JVM Does That? by (March 29th, 2011) ► The current status of JVMs: what works correctly, what does not work so correctly, and some suggestions of possible improvements.
- Your next JVM: Panama, Valhalla, Metropolis by John Rose by (March 23rd, 2017) ► A wishlist for future JVMs: using Java instead of C++, fibers replacing threads, unification of classes and primitives…
- The best HotSpot JVM options and switches for Java 11 through Java 17 — The JDK defaults for HotSpot are great, but sometimes you want to tinker. by (August 27th, 2021) ► Some general information about the JVM flags.
- Developers disassemble! Use Java and hsdis to see it all. — Use the HotSpot Disassembler to see what’s happening to your code. by (May 20th, 2022) ► presents hsdis and JITWatch for analysing the native assembly generated by the JVM.
-
IBM’s multitenancy
- Introduction to Java multitenancy — Learn about a new feature for cloud systems in the IBM SDK Java Technology Edition, Version 7 Release 1🗑️ by and (September 17th, 2013) ► IBM completed in Java 8 JVM to support running isolated applications in a single JVM instance.
-
Java multitenancy: Configuration options, tenant lifecycle, and isolation in action — Dig deeper into the multitenancy implementation in the IBM SDK Java Technology Edition, Version 7 Release 1🗑️ by and (August 31st, 2014) ► The
java
andjavad
command line options and some simple examples of using multitenancy.
-
Class loaders
- Java programming dynamics, Part 1: Classes and class loading — A look at classes and what goes on as they're loaded by a JVM🗑️ by (April 29th, 2003) ► A presentation of the class loaders, but more theoretical than applicable.
-
Cracking Java byte-code encryption — Why Java obfuscation schemes based on byte-code encryption won't work by (May 9th, 2003) ► The title says it all: just hack
java.lang.ClassLoader.defineClass()
in your JRE. - Class sharing in Eclipse OpenJ9 — Reduce your memory footprint and improve startup performance with the shared class feature by and (June 6th, 2018) ► A detailed introduction to OpenJ9’s shared classes cache.
-
Bytecodes
- Java programming dynamics, Part 4: Class transformation with Javassist — Using Javassist to transform methods in bytecode🗑️ by (September 16th, 2003) ► After a short presentation of Javassist, the author gives an example of its use by patching methods to measure method execution timings.
- Java programming dynamics, Part 5: Transforming classes on-the-fly — Learn how to modify classes as they're being loaded with Javassist🗑️ by (February 3rd, 2004) ► A combination of byte code manipulation and class loading interception, in order to patch classes as they are loaded.
- Using the ASM Toolkit for Bytecode Manipulation🗑️ by (October 6th, 2004) ► A presentation of ASM, a toolkit to parse, modify and generate bytecodes.
- Create and Read J2SE 5.0 Annotations with the ASM Bytecode Toolkit🗑️ by (October 20th, 2004) ► This toolkit also handles annotations, enabling management of Java 1.5 annotations with earlier JREs.
- CGLib: The Missing Manual by (January 7th, 2014) ► A fast-paced overview of cglib.
- JDK 11 and Proxies in a World Past sun.misc.Unsafe — Java 11 is making changes to the Unsafe class. See what's being deprecated and how that's going to affect proxies for future projects. by (April 22nd, 2018) ► cglib will not be usable anymore, the author gives some short explanations on using Byte Buddy to replace it.
-
Obfuscation
- The New Obfuscation🚫 by (October 22nd, 2004) ► The interest of obfuscation and some obfuscating methods.
-
Decompilers
- Java decompilers compared — Our detailed examples of how 3 top decompilers handle an extensive test suite will help you determine which, if any, meet your needs by (July 1st, 1997) ► A very basic comparison of DejaVu, Mocha, and WingDis.
-
Applets
- Applets Reloaded: the New Java Plug-In by (August 28th, 2008) ► This presentation of the new applet plugin implementation in Java 1.6 contains more demonstrations than technical information.
-
Diagnosing Java Code: I don’t know why I read this series since most of these articles are (in my personal opinion) not clear, misleading, and/or of little interest. But, at least, they provide some material to think about.
- Diagnosing Java Code: The Liar View bug pattern — Be your GUI's best friend and expose the Liar View🗑️ by ► It is better to perform unit tests by checking the view rather than the model.
- Bug patterns: An introduction — Diagnosing and correcting recurring bug types in your Java programs🚫 by (February 2001) ► Cut ’n paste code results into a program difficult to maintain, it is better to factorise the code.
- Diagnosing Java Code: The Dangling Composite bug pattern — Squash one of the most common causes of the null-pointer exception🗑️ by (March 2001) ► Use dedicated special classes to indicate base cases (e.g. an empty linked list) instead of a null pointer.
- Diagnosing Java Code: The Null Flag bug pattern — Avoid using null pointers as flags for exceptions🗑️ by (March 2001) ► It is better to throw an exception that to return a null pointer in case of an error: developers using your code will less likely to accidentally forget to check the error condition.
- Diagnosing Java code: The Double Descent bug pattern — Beat recursive class-casting conceptual errors at the start🗑️ by (April 2001) ► In a recursive structure of objects of different classes (themselves forming a hierarchy), replace the use of casts by methods implemented in each subclasses.
- Diagnosing Java Code: The Saboteur Data bug pattern — Hidden data bombs may be the key to odd crashes🗑️ by (May 2001) ► The advice is obvious: check input data before storing or manipulating it.
- Diagnosing Java Code: The Broken Dispatch bug pattern — Argument upcasting cures inaccurate method invocation🗑️ by (May 2001) ► I agree with the bug, but its analysis and the proposed solution are wrong: the issue here is that when using polymorphism, all the overloaded methods should have the same semantic, having a constructor accepting raw data and another construction performing parsing is a basic mistake in the class design, a factory should have been used for the parsing instead of the second constructor.
- Diagnosing Java Code: Improve the performance of your Java code — Tail-recursive transformations can speed up your apps, but not all JVMs can perform the task🗑️ by (May 2001) ► The advice is obvious: if you care about performance, use loops instead of recursions. The remainder of this article is not clear and has no interest.
-
Design
- Double Dispatch in DDD by (March 17th, 2024) ► How to dispatch method calls depending on the receiver and argument types, but the example is too simple to prove the value of the pattern.
-
Functional programming
- Lisp and Java🗑️ by (April 24th, 2004) ► The author seems to discover the notion of functors…
- Functional programming in the Java language — Use closures and higher order functions to write modular Java code🗑️ by (July 13th, 2004) ► Yet another presentation of functors (here called closures).
- Advanced Topics In Programming Languages: Closures For Java by (October 9th, 2007) ► After explaining that closures do not really exist in current Java and why they would be useful, describes the current implementation proposition (planned to be integrated in Java 7) and gives some examples of using it.
-
AOP
- Improve modularity with aspect-oriented programming — AspectJ brings AOP to the Java language🗑️ by (January 1st, 2002) ► A presentation of AspectJ.
- Use AOP to maintain legacy Java applications — Techniques for dealing with complex and unfamiliar Java code🗑️ by (March 9th, 2004) ► The author explains how to use AOP to find where is called a given interface, to detect dead code, to test exception handling, to patch code… But this is only a poor man solution, it is better and faster to use the proper tools to analyse code.
-
Dependency injection
- Dependency injection with Guice — Testable code with less boilerplate🗑️ by (December 9th, 2008) ► A presentation of Guice, but this one is probably too fast and the examples are too artificial to be really clear.
- Google I/O 2009 - Big Modular Java with Guice by and (June 3rd, 2009) ► A presentation of Guice: dependency injection (constructor, method, field), scopes (application, session, request), GWT/GIN and AOP.
- Guide to Google Guice (May 11th, 2024) ► A short overview of Guice.
-
Data-Oriented Programming
- Data Oriented Programming in Java↑ by (June 20th, 2022) ► How to used records and sealed classes to model data and pattern matching to handle it.
-
Data-Oriented Programming v1.1
- Data-Oriented Programming in Java - Version 1.1 by (May 23rd, 2024) ► A preamble to the Data-Oriented Programming presentation.
-
Model Data Immutably and Transparently - Data-Oriented Programming v1.1 by (May 27th, 2024) ► Data objects should be immutable and transparent, so
record
s are a good fit; but getting complete immutability is difficult. -
Model Data, the Whole Data, and Nothing but the Data - Data-Oriented Programming v1.1 by (May 29th, 2024) ► Sealed types and some advice on using
record
s. - Make Illegal States Unrepresentable - Data-Oriented Programming v1.1 by (June 3rd, 2024) ► Data validity that can be imposed by the data structure is better, otherwise the validity hsould be checked at the system boundary.
- Separate Operations From Data - Data-Oriented Programming v1.1 by (June 5th, 2024) ► The pros of using pattern matching for implementing business logic in operation classes, but the cons are not described.
- When to use Data-Oriented Programming v1.1 by (June 10th, 2024) ► The title says it all.
- Why Update Data-Oriented Programming to Version 1.1? by (June 26th, 2024) ► explains why he reworked ’s initial description of DOP and why he is still not fully satisfied by the new one.
-
Libraries
- Java FTP client libraries reviewed — Learn how the available libraries stack up against each other by (April 4th, 2003) ► A benchmark of some FTP libraries and the issues of this protocol.
- SMS-Powered Applications🗑️ by (June 9th, 2004) ► A good introduction of the SMPP API used to send and receive SMSes.
- Generate PDF files from Java applications dynamically — A step-by-step guide to iText, an open source library that makes PDF creation easy🗑️ by (January 26th, 2006) ► A short introduction to iText.
- Web Swinging🚫 by (October 12th, 2006) ► A presentation of SwingX-WS which can be used to generate HTTP requests and parse the answers by using a high-level API.
- Generating business documents using JasperReports with WebSphere — Introduction to the Java API for JasperReports↓🗑️ by (August 19th, 2009) ► This presentation of JasperReports is not very clear.
- Build better Web applications with Google Sitebricks — Create a sample Java Web application using Maven, Sitebricks, and Guice🗑️ by (February 16th, 2010) ► A presentation of Sitebricks being used with Maven and Guice.
- Introducing JobRunr: A distributed job scheduler for Java — A quick tutorial on an open source library that leverages lambdas and Spring by (January 16th, 2021) ► A short presentation of JobRunr: a distributed job scheduler with persistent storage.
- Guava: A treasure trove of Java functionality — This broad collection of utilities and functions from Google merits a principal place in your toolkit. by (May 1st, 2021) ► A presentation of Guava.
- Make Java REST development easier with the Jareto library by (May 15th, 2021) ► An introduction to Jareto: a library for REST applications simplifying the transport of exceptions and the manipulation of HTTP code and headers.
- Web microservices development in Java that will Spark joy — The Spark framework might be the platform you need for building web applications that run in the JVM. by (June 25th, 2021) ► A presentation of Spark: a small framework for implementing Web applications or Web services.
- Parsing YAML with SnakeYAML (May 11th, 2024) ► An introduction to SnakeYAML.
-
Jakarta Commons
- Using the Jakarta Commons, Part 1🗑️ by (June 25th, 2003) ► A presentation of Command Line Interface, Discovery, Lang, Collections, FileUpload, HTTPClient and Net.
- ↪Using the Jakarta Commons, Part 2🗑️ by (July 9th, 2003) ► A presentation of Codec, Modeler, Betwist, Digester, Jelly and JXPath.
- ↪Using the Jakarta Commons, Part 3🗑️ by (July 23rd, 2003) ► A presentation of BeanUtils, Logging, Pool and Validator.
-
JNA
-
JNA: Reading Windows Event Log entries in Java by (September 30th, 2010) ► A description of
EventLogIterator
implementation to read the Windows event log. - JNA with Maven Quickstart by (October 2nd, 2018) ► A simple example of using JNA with Maven.
-
JNA: Reading Windows Event Log entries in Java by (September 30th, 2010) ► A description of
-
Spring
- What's new in Spring Framework 5 — How Spring 5 leverages Java 8’s functional syntax and a new, reactive programming model by (September 19th, 2017) ► The title says it all.
- Spring Boot Scaling Strategies: Scheduled Tasks by (January 8th, 2024) ► How to manage scheduled tasks in a Spring application which is scaled horizontally.
-
Lombok
-
Eliminate Java verbosity the easy way🗑️ by (February 16th, 2010) ► An introduction to Lombok, a utility that generates
toString()
,equals()
,hashCode()
, getters, setters, synchronisation, exception handling… - Using Lombok’s @Getter for Boolean Fields (January 8th, 2024) ► The title says it all.
- Using Lombok Library With JDK 23 — In this brief tutorial, learn how to avoid compilation errors when using the Lombok library with Java 23. by (October 1st, 2024) ► The subtitle says it all.
-
Eliminate Java verbosity the easy way🗑️ by (February 16th, 2010) ► An introduction to Lombok, a utility that generates
-
POI
- Read, recycle, and reuse: Reporting made easy with Excel, XML, and Java technologies, Part 1 — Read Excel files and write them to new files using Java and XML technologies🗑️ by (February 16th, 2010) ► After listing some Java libraries able to read/write Excel files, the author gives an example on using Apache’s POI to parse an Excel file.
- ↪Read, recycle, and reuse: Reporting made easy with Excel, XML, and Java technologies, Part 2 — Convert between XML and Excel reporting formats🗑️ by (March 2nd, 2010) ► The example continues, using XOM to write an XML file and POI to write an Excel file correctly formatted.
-
Hadoop
- Business intelligence on the cheap with Apache Hadoop and Dojo, Part 1: Crunch your existing data using Apache Hadoop — Feed a web-based reporting application🗑️ by (August 17th, 2010) ► How to use Hadoop to map, reduce and format the data.
- ↪Business intelligence on the cheap with Apache Hadoop and Dojo, Part 2: Create eye-catching, interactive reports using the Dojo toolkit — Take advantage of Dojo charts🗑️ by (August 31st, 2010) ► Using Dojo to interactively display the data prepared by Hadoop.
- What is Apache Hadoop? by (June 27th, 2024) ► An overview of Hadoop ecosystem.
-
Struts
- Struts↓ by (June 1st, 2004) ► This presentation of Struts is not clear.
-
Eclipse Collections
- Nine Features in Eclipse Collections 9.0 by (September 14th, 2017) ► The title says it all.
- Code Duplication by (May 1st, 2019) ► This is not about code duplication, but about presenting some patterns of collection initialisation, filtering and content short-circuit testing.
-
MicroProfile
- Archived | MicroProfile 1.3 — Discover five new APIs in Eclipse MicroProfile 1.3🗑️ by (April 30th, 2018) ► A short presentation of MicroProfile and the new features available in 1.3.
-
Coherence
- Hello, Coherence Community Edition, Part 1: Creating cloud native stateful applications that scale — Use the open source Oracle Coherence Community Edition to create stateful applications that are as easy to scale, if not easier, than the stateless applications you are building today. by (August 14th, 2020) ► The implementation of a CRUD REST API.
- ↪Hello, Coherence Community Edition, Part 2: Building the client — How to develop React and JavaFX front-end clients that can work with a Coherence CE back-end application by (October 11th, 2020) ► Implementing a Web client (using React) and a Java Client (using JavaFx).
-
JavaParser
- JavaParser: where should we head? How to generate, transform, analyze, refactor Java code by (February 4th, 2018) ► A short overview of the library.
-
Jersey
- Exploring the Jersey Test Framework by (January 1st, 2024) ► The title says it all.
-
JAR
- JAR files revealed — Explore the power of the JAR file format🗑️ by and (October 9th, 2003) ► An overview of JAR capabilities: compression, executable JAR, sealing, extension mechanism, signing…
-
5 things you didn't know about … JARs — A Java Archive is more than just a bundle of classes🗑️ by (June 15th, 2010) ► Defining the main class, setting the classpath, storing JARs in
lib/ext
, classpath wildcard, and storing auxiliary files in the JAR.
-
Interaction with the system
-
Taming Tiger: Get environment variables and invoke subprocesses — When deprecated doesn't mean forever🗑️ by (September 30th, 2004) ► The
System.getenv()
method and theProcessBuilder
class. -
From Runtime.exec() to ProcessBuilder🚫 (2005) ► Using
ProcessBuilder
to fork a process. -
5 things you didn't know about … the Java Scripting API — An easier way to do scripting on the Java platform🗑️ by (July 27th, 2010) ► Using
jrunscript
andScriptEngine
to launch scripts, bind objects to them, and compile them.
-
Taming Tiger: Get environment variables and invoke subprocesses — When deprecated doesn't mean forever🗑️ by (September 30th, 2004) ► The
-
Databases
- Advanced DAO programming — Learn techniques for building better DAOs🗑️ by (October 7th, 2003) ► Some advice for implementing the Data Access Object design pattern: handling the transaction demarcations inside the DAO or leaving the client to handle them, using JDBC vs. JTA, logging and exception handling.
-
Archived | Java Database Connectivity — Update your relationship to the JDBC API🗑️ by and (August 10th, 2010) ► Getting the list of scalar functions, scrollable and updateable
ResultSet
s,RowSet
s, and batch updates. - Develop Spring Redis applications — Build Spring-based applications with Redis as the datastore🗑️ by (August 21st, 2013) ► A presentation of Redis and Spring Java Redis.
-
Servlets
-
Java theory and practice: Are all stateful Web applications broken? — HttpSession and friends are trickier than they look🗑️ by (September 23rd, 2008) ► How to properly use
ServletContext
andHttpSession
to avoid race conditions.
-
Java theory and practice: Are all stateful Web applications broken? — HttpSession and friends are trickier than they look🗑️ by (September 23rd, 2008) ► How to properly use
-
Annotations
- Getting started with JML — Improve your Java programs with JML annotation🚫 by (March 18th, 2003) ► A presentation of JML: an assertion mechanism.
- Declarative Programming in Java🚫 by (April 24th, 2004) ► A good introduction to Java annotations.
-
Annotations in Tiger, Part 1: Add metadata to Java code — How to use Java 5's built-in annotations🗑️ by (September 2nd, 2004) ► Using
@Override
,@Deprecated
and@SuppressWarnings
. -
↪Annotations in Tiger, Part 2: Custom annotations — Write your own annotations in Java 5🗑️ by (September 2nd, 2004) ► How to define your own annotation and annotate them with
@Target
,@Retention
,@Documented
and@Inherited
. - Bridging the Gap: J2SE 5.0 Annotations🗑️ by (October 6th, 2004) ► Yet another presentation of the annotations, not the best one, but the author describes here the other existing annotation mechanisms: XDoclet, Common Attributes, JBoss, SGen and P.Anno.
- Advanced Topics In Programming Languages: JSR-305: Java annotations for software defect detection by (August 8th, 2007) ► A proposition of an annotation mechanism that the developer could use to provide hints to static analysers.
- The Open Road: javax.annotation🚫 by (November 9th, 2008) ► A description of the JSR 305 annotations.
- Explore Annotations in Java 8 — Explore the evolution of annotations in Java 8 and how they are being used today! by (October 22nd, 2019) ► A not-so-clear summary of annotations.
-
Javadoc
- Java theory and practice: I have to document THAT? — Integrated documentation a la Javadoc is both a benefit and a burden🗑️ by (August 1st, 2002) ► A checklist of what should be documented.
-
Java EE / Jakarta EE
- Java API for JSON Processing: An Introduction to JSON — The Java API for JSON Processing provides portable APIs to parse, generate, transform, and query JSON. by (July 2013) ► An overview of the Java API for JSON Processing.
- What's new in Java EE 8 — A first look at new APIs and features for Java security, JSON binding and processing, HTTP/2, and more🚫 by (September 26th, 2017) ► The title says it all.
- Transition from Java EE to Jakarta EE — What happened and what you need to know by (February 27th, 2020) ► A description of the long process of transforming Java EE into Jakarta EE.
-
Get started with the JSON Binding API
- Archived | The JSON Binding API in a nutshell — Get started with JSON-B's default features and custom annotations, runtime configurations, and more🗑️ by (November 10th, 2017) ► An overview of the API: the handling of the different types, the default mapping and the different ways to customise the mapping (annotations, adapters and serialisers/deserialisers).
- ↪Archived | Default mapping with JSON-B — Everyday serialization and deserialization with the JSON Binding API🗑️ by (November 18th, 2017) ► A detailed description of the default mapping.
- ↪Archived | Custom binding with JSON-B — Customize JSON binding with annotations and runtime configuration🗑️ by (November 21st, 2017) ► A detailed description of customising the mapping.
- ↪Archived | Is it time for a JSON binding standard? — Comparing Gson, Jackson, and JSON-B highlights inconsistencies in basic features and behavior🗑️ by (December 15th, 2017) ► The subtitle says it all.
-
Get started with concurrency in Jakarta EE — One of the cornerstones of any well-written application is good performance, and that often means being able to run two or more tasks at the same time in parallel. by (June 22nd, 2020) ► An introduction to the basics of multi-threading in Jakarta EE:
ManagedExecutorService
,ManagedScheduledExecutorService
, andManagedThreadFactory
.
-
Tools
- Using JConsole to Monitor Applications by (December 2004) ► An overview of JConsole.
- Java postmortem diagnostics, Part 1: Introduction to JSR 326 and Apache Kato — Learn how the Apache Kato project can help you analyze the causes of JVM failure🗑️ by (May 5th, 2009) ► A high-level introduction to post-mortem analysis.
-
A JDeps Tutorial - Analyze Your Project's Dependencies by (July 17th, 2017) ► A short presentation of
jdeps
.
-
Maven
- 5 things you didn't know about ... Apache Maven — Tips for managing the project life cycle with Maven🗑️ by (October 5th, 2010) ► Defining an executable JAR, customising MANIFEST.MF, dumping the dependency tree, using profiles, and writing a plug-in.
- 5 things you didn't know about ... Apache Maven plugins — Tips for mastering modern Maven plugins🗑️ by (September 11th, 2017) ► Signing a JAR/WAR, deploying in a container, installing a JAR from a local directory, storing the build artifacts on GitHub, identifying unused dependencies, purging the local repository, adding a timestamp, and printing Maven property values.
- Migrate Maven Projects to Java 11 by (August 29th, 2018) ► The title says it all.
- Building Java Applications With Maven — Check out this stellar Java tutorial on building applications with Maven. by (December 2nd, 2019) ► An overview of Maven.
- Faster Maven builds↑ by (October 3rd, 2021) ► A good overview of the options to accelerate Maven builds.
- How to generate Maven Wrapper files (mvnw and mvnw.cmd) by (September 5th, 2023) ► How to generate the Maven Wrapper files.
- Maven Dependency Scope Applied — Learn how to use Maven's dependency scope to adhere to the chosen architecture in a multi-module project. by (January 22nd, 2024) ► Using Maven’s Dependency Scope to ensure the respect of proper dependencies between the application modules.
- Use the Latest Version of a Dependency in Maven by (January 23rd, 2024) ► An overview of Versions Maven Plugin.
- Refer to Environment Variables in pom.xml by (January 27th, 2024) ► The title says it all.
-
Puzzles
- Java Puzzlers Episode VI: The Phantom-Reference Menace, Attack of the Clone, & Revenge of the Shift by and (July 23rd, 2007) ► Eight Java puzzles.
- How to Find Missing Number on Integer Array of 1 to 100 - BitSet Example by (November 28th, 2017) ► The title says it all.
-
Non-Volatile Memory and Java
- Non-Volatile Memory and Java by (April 12th, 2019) ► A description of Intel’s Optane, a Non-Volatile DIMM.
- ↪Non-Volatile Memory and Java: Part 2 by and (April 19th, 2019) ► How the software will handle NVRAM and the consistency problem that another thread may see data not yet persisted, may persist some other data, and hence we would get inconsistent persisted data in case of a power failure.
- ↪Non-Volatile Memory and Java: Part 3 by (April 26th, 2019) ► The impact of NVRAM on software: handling hardware errors, the fact that restarting the application will no more be the simple solution to solve a problem since the saved data may be incorrect…
- ↪Non-Volatile Memory and Java: Part 4 by (May 30th, 2019) ► Some problems with how Java could exploit NVRAM, in particular the problem of type evolution.