eBook – Guide Spring Cloud – NPI EA (cat=Spring Cloud)
announcement - icon

Let's get started with a Microservice Architecture with Spring Cloud:

>> Join Pro and download the eBook

eBook – Mockito – NPI EA (tag = Mockito)
announcement - icon

Mocking is an essential part of unit testing, and the Mockito library makes it easy to write clean and intuitive unit tests for your Java code.

Get started with mocking and improve your application tests using our Mockito guide:

Download the eBook

eBook – Java Concurrency – NPI EA (cat=Java Concurrency)
announcement - icon

Handling concurrency in an application can be a tricky process with many potential pitfalls. A solid grasp of the fundamentals will go a long way to help minimize these issues.

Get started with understanding multi-threaded applications with our Java Concurrency guide:

>> Download the eBook

eBook – Reactive – NPI EA (cat=Reactive)
announcement - icon

Spring 5 added support for reactive programming with the Spring WebFlux module, which has been improved upon ever since. Get started with the Reactor project basics and reactive programming in Spring Boot:

>> Join Pro and download the eBook

eBook – Java Streams – NPI EA (cat=Java Streams)
announcement - icon

Since its introduction in Java 8, the Stream API has become a staple of Java development. The basic operations like iterating, filtering, mapping sequences of elements are deceptively simple to use.

But these can also be overused and fall into some common pitfalls.

To get a better understanding on how Streams work and how to combine them with other language features, check out our guide to Java Streams:

>> Join Pro and download the eBook

eBook – Jackson – NPI EA (cat=Jackson)
announcement - icon

Do JSON right with Jackson

Download the E-book

eBook – HTTP Client – NPI EA (cat=Http Client-Side)
announcement - icon

Get the most out of the Apache HTTP Client

Download the E-book

eBook – Maven – NPI EA (cat = Maven)
announcement - icon

Get Started with Apache Maven:

Download the E-book

eBook – Persistence – NPI EA (cat=Persistence)
announcement - icon

Working on getting your persistence layer right with Spring?

Explore the eBook

eBook – RwS – NPI EA (cat=Spring MVC)
announcement - icon

Building a REST API with Spring?

Download the E-book

Course – LS – NPI EA (cat=Jackson)
announcement - icon

Get started with Spring and Spring Boot, through the Learn Spring course:

>> LEARN SPRING
Course – RWSB – NPI EA (cat=REST)
announcement - icon

Explore Spring Boot 3 and Spring 6 in-depth through building a full REST API with the framework:

>> The New “REST With Spring Boot”

Course – LSS – NPI EA (cat=Spring Security)
announcement - icon

Yes, Spring Security can be complex, from the more advanced functionality within the Core to the deep OAuth support in the framework.

I built the security material as two full courses - Core and OAuth, to get practical with these more complex scenarios. We explore when and how to use each feature and code through it on the backing project.

You can explore the course here:

>> Learn Spring Security

Course – LSD – NPI EA (tag=Spring Data JPA)
announcement - icon

Spring Data JPA is a great way to handle the complexity of JPA with the powerful simplicity of Spring Boot.

Get started with Spring Data JPA through the guided reference course:

>> CHECK OUT THE COURSE

Partner – Moderne – NPI EA (cat=Spring Boot)
announcement - icon

Refactor Java code safely — and automatically — with OpenRewrite.

Refactoring big codebases by hand is slow, risky, and easy to put off. That’s where OpenRewrite comes in. The open-source framework for large-scale, automated code transformations helps teams modernize safely and consistently.

Each month, the creators and maintainers of OpenRewrite at Moderne run live, hands-on training sessions — one for newcomers and one for experienced users. You’ll see how recipes work, how to apply them across projects, and how to modernize code with confidence.

Join the next session, bring your questions, and learn how to automate the kind of work that usually eats your sprint time.

Course – LJB – NPI EA (cat = Core Java)
announcement - icon

Code your way through and build up a solid, practical foundation of Java:

>> Learn Java Basics

1. Introduction

As Android developers, we come across situations where we need to convert an AAR file to a JAR file. This normally happens when we want to use a library or module in our Java project that’s only available in the AAR format.

In this tutorial, we’ll learn the steps to convert an AAR file to a JAR file.

2. What Is an AAR File?

An AAR (Android ARchive) file is a package file format used in the Android operating system to distribute and share libraries, resources, and code between Android projects.

It’s similar to the JAR (Java Archive) file format, but it includes additional metadata for Android applications, such as AndroidManifest.xml, resource files, res folder (layout, values, drawable), proguard rules and others.

Android developers use the AAR file format to distribute their libraries and share their code between projects. It allows developers to easily manage their dependencies and integrate external libraries into their Android applications.

AAR files can be included in an Android project using build tools such as Gradle or Maven. These build tools automatically handle the dependencies and integrate them into the build process.

In short, AAR files play an important role in the Android development ecosystem, as they enable developers to build high-quality, efficient, and scalable applications.

3. What Is a JAR File?

A JAR (Java ARchive) file is a package file format used to store and distribute Java class files, resources, and associated metadata. It’s similar to a ZIP file in that it’s a compressed archive format that contains multiple files and folders.

JAR files are commonly used to distribute Java libraries or applications. Any platform that has a Java Runtime Environment (JRE) installed can execute JAR files.

JAR files are created using the jar command-line tool that comes with the Java Development Kit (JDK). They can be signed with a digital certificate to ensure their authenticity and integrity. They can also include a manifest file that provides metadata about the JAR file, such as the version number, author, and dependencies.

JAR files are an important part of the Java development ecosystem. It allows developers to package and distribute their Java code as a single, executable file. This makes it easier to share and distribute Java applications and libraries, and it also simplifies the deployment process for end-users.

4. Convert an AAR File to a JAR File

There may be situations where we need to convert an AAR file to a JAR file, such as when we want to use an Android library in a non-Android Java project. We’ll look at couple of approaches for doing that.

4.1. By Extracting the Contents of AAR Manually Using Zip

The first step in converting an AAR file to a JAR file is to extract the contents of the AAR file. We can do this by changing the extension of the AAR file to .zip. Then we’ll extract its contents using a tool like WinZip or 7-Zip. Once we have extracted the contents of the AAR file, we should see a folder with the same name as the AAR file.

Inside the extracted folder, we’ll see several files and folders. We need to look for the classes.jar file as it contains the Java class files that we want to convert to a JAR file. Then we’ll locate the classes.jar file and copy it to a new folder.

To convert the classes.jar file to a JAR file, we can use the jar command-line tool that comes with the Java Development Kit (JDK). We’ll open command prompt or terminal window as per our operating system. We’ll use the following command in the folder where we copied the classes.jar file.

$ jar -xf classes.jar

This should extract the contents of the classes.jar file into a new folder called classes.

Next, the following command, where mylibrary.jar is the name of the resultant JAR, creates a JAR file:

$ jar -cf mylibrary.jar -C classes/ .

A new JAR file named “mylibrary.jar” will be created in the same folder as the extracted classes. Let’s understand that the -C option tells the jar tool to change to the classes directory before adding its contents to the JAR file.

4.2. Using Android Studio

As Android developers we have access to Android studio. We can also use it to convert an AAR file to a JAR file using following steps:

We’ll navigate to File > New > New Module > Import .JAR/.AAR Package and select the desired AAR file and click Finish.

Generally, build.gradle file contains the following plugin:

apply plugin: 'com.android.library'

If it doesn’t exist, then we’ll add following line. If it exists, then we’ll replace it with the following line:

apply plugin: 'java-library'

Next, we’ll navigate to Build > Make module ‘Module Name’.  We should see the JAR file located in the build/libs folder of the module, once the module is built.

5. Conclusion

In this article, we learned about contents and usage of an AAR file and a JAR file. We also saw how we can convert an AAR file to a JAR file manually using ZIP and Android studio.

Baeldung Pro – NPI EA (cat = Baeldung)
announcement - icon

Baeldung Pro comes with both absolutely No-Ads as well as finally with Dark Mode, for a clean learning experience:

>> Explore a clean Baeldung

Once the early-adopter seats are all used, the price will go up and stay at $33/year.

eBook – HTTP Client – NPI EA (cat=HTTP Client-Side)
announcement - icon

The Apache HTTP Client is a very robust library, suitable for both simple and advanced use cases when testing HTTP endpoints. Check out our guide covering basic request and response handling, as well as security, cookies, timeouts, and more:

>> Download the eBook

eBook – Java Concurrency – NPI EA (cat=Java Concurrency)
announcement - icon

Handling concurrency in an application can be a tricky process with many potential pitfalls. A solid grasp of the fundamentals will go a long way to help minimize these issues.

Get started with understanding multi-threaded applications with our Java Concurrency guide:

>> Download the eBook

eBook – Java Streams – NPI EA (cat=Java Streams)
announcement - icon

Since its introduction in Java 8, the Stream API has become a staple of Java development. The basic operations like iterating, filtering, mapping sequences of elements are deceptively simple to use.

But these can also be overused and fall into some common pitfalls.

To get a better understanding on how Streams work and how to combine them with other language features, check out our guide to Java Streams:

>> Join Pro and download the eBook

eBook – Persistence – NPI EA (cat=Persistence)
announcement - icon

Working on getting your persistence layer right with Spring?

Explore the eBook

Course – LS – NPI EA (cat=REST)

announcement - icon

Get started with Spring Boot and with core Spring, through the Learn Spring course:

>> CHECK OUT THE COURSE

Partner – Moderne – NPI EA (tag=Refactoring)
announcement - icon

Modern Java teams move fast — but codebases don’t always keep up. Frameworks change, dependencies drift, and tech debt builds until it starts to drag on delivery. OpenRewrite was built to fix that: an open-source refactoring engine that automates repetitive code changes while keeping developer intent intact.

The monthly training series, led by the creators and maintainers of OpenRewrite at Moderne, walks through real-world migrations and modernization patterns. Whether you’re new to recipes or ready to write your own, you’ll learn practical ways to refactor safely and at scale.

If you’ve ever wished refactoring felt as natural — and as fast — as writing code, this is a good place to start.

Course – LS – NPI (cat=Java)
announcement - icon

Get started with Spring Boot and with core Spring, through the Learn Spring course:

>> CHECK OUT THE COURSE

eBook Jackson – NPI EA – 3 (cat = Jackson)