When Does Java’s Foreign Function & Memory API Actually Make Sense?

Every new Java release introduces a shiny feature. The Foreign Function & Memory (FFM) API, finalized in Java 22, is one of those headline acts: it promises safe native calls without JNI and off-heap memory you can manage. But the real question is not “can I use it?” but “should I reach for it?” The … Read more

Building Robust AI Applications with LangChain4j Guardrails and Spring Boot

As AI applications become increasingly complex, ensuring that language models behave predictably and safely is paramount. LangChain4j’s guardrails feature provides a powerful framework for validating both the inputs and outputs of your AI services. This article demonstrates how to implement comprehensive guardrails in a Spring Boot application, with practical examples that you can adapt to … Read more

Java’s Structured Concurrency: Finally Finding Its Footing

The structured concurrency API changed again after two incubations and four rounds of previews. Ideally, this scenario is unexpected. However, given its status as a preview API, such changes can occur, as was the case here. These changes lend considerable maturity to the API, and I am hopeful it will now stabilize without requiring further … Read more

ধুলোর স্বাদ

Part 1: Part 2   ধুলোর স্বাদ কেমন হয়? আমাদের কারোরই জানার কথা নয়! এও কি জানার মত কিছু? তবে ছ’বছরের ইউসুফ এখন এই স্বাদটার সাথে বেশি পরিচিত। ধুলোয় তার জিভেতে একটা যেন প্রলেপ পড়ে গেছে, গলার পিছনেও খানিকটা জমে আছে। মনে হয় একটা খসখসে পর্দা। “মা,” সে মাঝে মাঝে ভাঙা গলায় নালিশ করে, “আমার … Read more

Chat with Your Knowledge Base: A Hands-On Java & LangChain4j Guide

Disclaimer: This article details an experimental project built for learning and demonstration purposes. The implementation described is not intended as a production-grade solution. Some parts of the code were generated using JetBrains’ AI Agent, Junie. Large Language Models (LLMs) like GPT-4, Llama, and Gemini have revolutionized how we interact with information. However, their knowledge is … Read more

Building FormPilot: My Journey Creating an AI-Powered Form Filler with RAG, LangChain4j, and Ollama

Disclaimer: This article details an experimental project built for learning and demonstration purposes. The implementation described is not intended as production-grade solution. Some parts of the code were generated using JetBrains’ AI Agent, Junie. Have you ever found yourself filling out the same information on web forms over and over again? Name, email, address, phone … Read more

DIY JVM Part 1: Decoding the Magic – Parsing Java

It’s been about 15 years since I last touched C programming. Back in university, I remember writing a small C program for an assignment—just a simple parser that could scan a C source file and check if its structures were correctly formed. It was nothing fancy, just a mundane academic exercise, and to be honest, … Read more

Java Tips # 01 –  Writing Shebang Scripts in Pure Java

Did you know you can write a CLI script in Java just as easily as you would in a bash script, and run it directly from the shell? This is commonly called a shebang script, though we are mostly familiar with writing them in bash. Bash scripts are great, but they can be obscure to … Read more

Exploring New Features in JDK 23: Simplifying Java with Primitive Type Patterns with JEP 455

Java continues to evolve, introducing features that streamline coding practices and improve readability. JEP 455 is one such proposal that enhances the switch statement, making it more versatile and expressive. This article delves into how JEP 455 can be utilized to handle complex decision-making scenarios more efficiently. We’ll examine a practical example to illustrate the … Read more

Exploring New Features in JDK 23: A Sneak Peek

The main method and println With JDK 23 on the horizon, I decided to dive into some of its new features by running the following code in the CLI: void main() { println(“Hello World”); var name = readln(“Enter your name: “); println(“Your name is ” + name); var age = readln(“Enter your age: “); println(“Your … Read more