Partner – Microsoft – NPI EA (cat = Baeldung)
announcement - icon

Azure Container Apps is a fully managed serverless container service that enables you to build and deploy modern, cloud-native Java applications and microservices at scale. It offers a simplified developer experience while providing the flexibility and portability of containers.

Of course, Azure Container Apps has really solid support for our ecosystem, from a number of build options, managed Java components, native metrics, dynamic logger, and quite a bit more.

To learn more about Java features on Azure Container Apps, visit the documentation page.

You can also ask questions and leave feedback on the Azure Container Apps GitHub page.

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

Azure Container Apps is a fully managed serverless container service that enables you to build and deploy modern, cloud-native Java applications and microservices at scale. It offers a simplified developer experience while providing the flexibility and portability of containers.

Of course, Azure Container Apps has really solid support for our ecosystem, from a number of build options, managed Java components, native metrics, dynamic logger, and quite a bit more.

To learn more about Java features on Azure Container Apps, you can get started over on the documentation page.

And, you can also ask questions and leave feedback on the Azure Container Apps GitHub page.

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

Modern software architecture is often broken. Slow delivery leads to missed opportunities, innovation is stalled due to architectural complexities, and engineering resources are exceedingly expensive.

Orkes is the leading workflow orchestration platform built to enable teams to transform the way they develop, connect, and deploy applications, microservices, AI agents, and more.

With Orkes Conductor managed through Orkes Cloud, developers can focus on building mission critical applications without worrying about infrastructure maintenance to meet goals and, simply put, taking new products live faster and reducing total cost of ownership.

Try a 14-Day Free Trial of Orkes Conductor today.

Partner – Orkes – NPI EA (tag=Microservices)
announcement - icon

Modern software architecture is often broken. Slow delivery leads to missed opportunities, innovation is stalled due to architectural complexities, and engineering resources are exceedingly expensive.

Orkes is the leading workflow orchestration platform built to enable teams to transform the way they develop, connect, and deploy applications, microservices, AI agents, and more.

With Orkes Conductor managed through Orkes Cloud, developers can focus on building mission critical applications without worrying about infrastructure maintenance to meet goals and, simply put, taking new products live faster and reducing total cost of ownership.

Try a 14-Day Free Trial of Orkes Conductor today.

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 – MongoDB – NPI EA (tag=MongoDB)
announcement - icon

Traditional keyword-based search methods rely on exact word matches, often leading to irrelevant results depending on the user's phrasing.

By comparison, using a vector store allows us to represent the data as vector embeddings, based on meaningful relationships. We can then compare the meaning of the user’s query to the stored content, and retrieve more relevant, context-aware results.

Explore how to build an intelligent chatbot using MongoDB Atlas, Langchain4j and Spring Boot:

>> Building an AI Chatbot in Java With Langchain4j and MongoDB Atlas

Partner – LambdaTest – NPI EA (cat=Testing)
announcement - icon

Accessibility testing is a crucial aspect to ensure that your application is usable for everyone and meets accessibility standards that are required in many countries.

By automating these tests, teams can quickly detect issues related to screen reader compatibility, keyboard navigation, color contrast, and other aspects that could pose a barrier to using the software effectively for people with disabilities.

Learn how to automate accessibility testing with Selenium and the LambdaTest cloud-based testing platform that lets developers and testers perform accessibility automation on over 3000+ real environments:

Automated Accessibility Testing With Selenium

1. Overview

This article looks at the keyboard shortcuts that we need to edit, build, and run Java applications in JetBrains’ Java IDE, IntelliJ IDEA. Keyboard shortcuts save us time because we can keep our hands on the keyboard and get things done faster.

We looked at refactoring with IntelliJ IDEA in a previous article, so we don’t cover these shortcuts here.

2. The One Shortcut

If we remember just one IntelliJ IDEA shortcut, then it must be Help – Find Action, which is Ctrl + Shift + A in Windows and Shift + Cmd + A in macOS. This shortcut opens a search window with all menu items and other IDE actions, whether they have a keyboard shortcut or not. We can immediately type to narrow our search, use the cursor keys to select a function, and use Enter to execute it.

From now on, we’ll list the keyboard shortcuts in parentheses directly behind the menu item name. If the shortcuts differ between Windows and macOS, as they usually do, then we put the Windows shortcut first and the macOS one second.

On macOS computers, the Alt key is typically called Option. We’ll still call it Alt in this article to keep our shortcuts brief.

3. Settings

Let’s start with configuring IntelliJ IDEA and our project.

We reach the settings of IntelliJ in Windows with File – Settings (Ctrl + Alt + S) and in macOS with IntelliJ IDEA – Preferences (Cmd + ,). To configure our current project, we select the top-level element in the Project view. It has the project name. Then we can open its configuration with File – Project Structure (Ctrl + Alt + Shift + S / Cmd + ;).

4. Navigating to Files

After the configuration, we can start coding. First, we need to get to the file we want to work on.

We pick files by exploring the Project view on the left. We can also create new files in the currently selected location with File – New (Alt + Insert / Cmd + N). To delete the currently selected file/folder, we trigger Edit – Delete (Delete / ). We can switch back from the Project view to the editor with Esc on Windows and on macOS. There is no menu item for this.

To open a class directly, we use Navigate – Class (Ctrl + N / Cmd + O). This applies to Java classes and classes in other languages, such as TypeScript or Dart. If we want to open any file instead, such as HTML or text files, we use Navigate – File (Ctrl + Shift + N / Shift + Cmd + O).

The so-called switcher is the list of currently open files. We can only see the switcher through its shortcut Ctrl + Tab as it has no menu entry. The list of recently opened files is available with View – Recent (Ctrl + E / Cmd + E). If we press that shortcut again, then we see only the recently changed files.

We go to the place of our last code changes with Navigate – Last Edit Location (Ctrl + Shift + Backspace / Shift + Cmd + ⌫). IntelliJ also tracks our editor file locations. We can navigate that history with Navigate – Back (Ctrl + Alt + Left / Cmd + [) and Navigate – Forward (Ctrl + Alt + Right / Cmd + ]).

5. Navigating Within Files

We arrived at the file we want to work on. Now we need to navigate to the right place there.

We jump to a field or method of a class directly with Navigate – File Structure (Ctrl + F12 / Cmd + F12). As with Help – Find Action, we can immediately type to narrow down the members shown, use the cursor keys to select a member, and use Enter to jump to that member. If we want to highlight a member’s usages in the current file, we use Edit – Find Usages – Find Usages in File (Ctrl + F7 / Cmd + F7).

We reach the definition of a base class or method with Navigate – Declaration or Usages (Ctrl + B / Cmd + B). As the name suggests, invoking functionality on a base class or method itself shows its usages instead. Since this is such a commonly used functionality, it has a mouse shortcut: Ctrl + Click on Windows and Cmd + Click on macOS. If we need to see all uses of a class or method in our project, we invoke Edit – Find Usages – Find Usages (Alt + F7).

Our code often calls other methods. If we put the cursor inside the method call parentheses, then View – Parameter Info (Ctrl + P / Cmd + P) reveals information on method parameters. In the default IntelliJ IDEA configuration, this parameter information automatically appears after a short delay.

To see the quick documentation window for a type or method, we need View – Quick Documentation (Ctrl + Q / F1). In the default IntelliJ IDEA configuration, the quick documentation automatically appears if we move the mouse cursor over the type or method and wait a bit.

6. Locate Current File

In large projects or those with many files, finding the current file in the project tree can be challenging. IntelliJ IDEA provides options to facilitate this task.

One option is to use the Help Find Action and run the Select File in Project View action.

Additionally, the project toolbar offers a convenient method. We can click on the crosshair icon (Alt + F1, 1 / FN + Option + F1) to highlight the currently open file in the project tree.

Alternatively, we can configure the project tool window to always highlight the currently open file. To do that, we select the three vertical dots in the project toolbar and select the Always Select Opened File option.

7. Editing Files

7.1. Changing the Code

Once we arrive at the right file and the right place, we can start editing our code.

When we start to type the name of variables, methods, or types, IntelliJ IDEA helps us finish those names with Code – Code Completion – Basic (Ctrl + Space). This function also automatically launches after a brief delay in the default IntelliJ IDEA configuration. We may need to type a closing parenthesis and have to put a semicolon at the end. Code – Code Completion – Complete Current Statement (Ctrl + Shift + Enter / Shift + Cmd + Enter) finishes our current line.

Code – Override Methods (Ctrl + O) lets us pick inherited methods to overwrite. And with Code – Generate (Alt + Insert / Cmd + N), we can create common methods like getters, setters, or toString().

We can use Code – Surround with (Ctrl + Alt + T / Alt + Cmd +T) to put control structures around our code, such as an if statement. We can even comment out a whole block of code with Code – Comment with Block Comment. That is Ctrl + Shift + / in Windows and Alt + Cmd + / in macOS.

IntelliJ IDEA automatically saves our code, for instance, before running it. We can still save all files manually with File – Save all (Ctrl + S / Cmd + S).

7.2. Navigating the Code

Sometimes, we need to move code around in our file. Code – Move Statement Up (Ctrl + Shift + Up / Alt + Shift +Up) and Code – Move Statement Down (Ctrl + Shift + Down / Alt + Shift +Down) do that for the currently selected code. If we have nothing selected, then the current line is moved. Similarly, Edit – Duplicate Line or Selection (Ctrl + D / Cmd + D) duplicates either the selected code or the current line.

We can cycle through errors in the current file with Navigate – Next Highlighted Error (F2) and Navigate – Previous Highlighted Error (Shift + F2). If we put the cursor on incorrect code and hit Alt + Enter, IntelliJ IDEA will suggest fixes. There is no menu item for this shortcut. That shortcut may also suggest changes to our code if it doesn’t have errors.

8. Find and Replace

We often need to find and replace code. Here’s how we can do this in the current file or all files.

To find text in our current file, we use Edit – Find – Find (Ctrl + F / Cmd + F). To replace text in our current file, we use Edit – Find – Replace (Ctrl + R / Cmd + R). In both cases, we move through the search results with Edit – Find – Find Next Occurrence (F3 / Cmd + G) and Edit – Find – Find Previous Occurrence (Shift + F3 / Shift + Cmd + G).

We can also find text in all our files with Edit – Find – Find in Files (Ctrl + Shift + F / Shift + Cmd + F). Likewise, Edit – Find – Replace in Files (Ctrl + Shift + R / Shift + Cmd +R) replaces text in all our files. We can still use F3 / Cmd + G and Shift + F3 / Shift + Cmd + G to move through our search result.

9. Build and Run

We want to run our project when we finish coding.

When we run our project, IntelliJ IDEA typically builds our projects automatically. With Build – Build Project (Ctrl + F9 / Cmd + F9), we validate manually if our recent code changes still compile. And we can rebuild our entire project from scratch with Build – Rebuild Project (Ctrl + Shift + F9 / Shift + Cmd + F9).

To run our project with the current run configuration, we use Run – Run ‘(configuration name)’ (Shift + F10 / Ctrl + R). We execute a particular run configuration with Run – Run… (Alt + Shift + F10 / Ctrl + Alt + R). In the same vein, we can debug the current run configuration with Run – Debug ‘(configuration name)’ (Shift + F9 / Ctrl + D) and any other run configuration with Run – Debug (Alt + Shift + F9 / Ctrl + Alt + D).

10. Debugging

Our project will have bugs. Debugging helps us find and fix these bugs.

The debugger stops at breakpoints. We view the current breakpoints with Run – View Breakpoints (Ctrl + Shift + F8 / Shift + Cmd + F8). We can toggle a breakpoint at the current line with Run – Toggle Breakpoint – Line Breakpoint (Ctrl + F8 / Cmd + F8).

When our code hits a breakpoint during debugging, we can step over the current line with Run – Debugging Actions – Step Over (F8). So if that line is a method, we’ll execute that entire method in one fell swoop. Alternatively, we can dive into the method at the current line with Run – Debugging Actions – Step Into (F7).

When debugging, we may want to run our code until the current method is finished. That’s what Run – Debugging Actions – Step Out (Shift + F8) does. If we want our program to run to the line where our cursor is, then Run – Debugging Actions – Run to Cursor (Alt + F9) accomplishes this. And if we want our program just to run until it encounters the next breakpoint, then Run – Debugging Actions – Resume Program (F9) does just that.

11. Git

Our programs typically reside in a Git repository. IntelliJ IDEA has excellent support for Git.

We have one keyboard shortcut to give us all possible Git operations: Git – VCS Operations (Alt + ` / Ctrl + V). As expected, we can select items with the cursor and hit Enter to execute them. This is also a good way to reach commonly used functionality that doesn’t have keyboard shortcuts by default, such as Show History or Show Diff.

If we want to update our project from a remote Git repository, then we go for Git – Update Project (Ctrl + T / Cmd + T). When we need to commit our changes in Git, then Git – Commit (Ctrl + K / Cmd + K) is available. To revert our changes to what’s in Git, we use Git – Uncommitted Changes – Rollback (Ctrl + Alt + Z / Alt + Cmd + Z). And Git – Push (Ctrl + Shift + K / Shift + Cmd + K) pushes our changes to a remote Git repository.

12. Conclusion

Keyboard shortcuts save us time because we can keep our hands on the keyboard and get things done faster. This article looked at shortcuts for configuring, navigating, editing, finding and replacing, running, and debugging our programs in IntelliJ IDEA.

We also looked at the shortcuts for working with Git.

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.

Partner – Microsoft – NPI EA (cat = Baeldung)
announcement - icon

Azure Container Apps is a fully managed serverless container service that enables you to build and deploy modern, cloud-native Java applications and microservices at scale. It offers a simplified developer experience while providing the flexibility and portability of containers.

Of course, Azure Container Apps has really solid support for our ecosystem, from a number of build options, managed Java components, native metrics, dynamic logger, and quite a bit more.

To learn more about Java features on Azure Container Apps, visit the documentation page.

You can also ask questions and leave feedback on the Azure Container Apps GitHub page.

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

Azure Container Apps is a fully managed serverless container service that enables you to build and deploy modern, cloud-native Java applications and microservices at scale. It offers a simplified developer experience while providing the flexibility and portability of containers.

Of course, Azure Container Apps has really solid support for our ecosystem, from a number of build options, managed Java components, native metrics, dynamic logger, and quite a bit more.

To learn more about Java features on Azure Container Apps, visit the documentation page.

You can also ask questions and leave feedback on the Azure Container Apps GitHub page.

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

Modern software architecture is often broken. Slow delivery leads to missed opportunities, innovation is stalled due to architectural complexities, and engineering resources are exceedingly expensive.

Orkes is the leading workflow orchestration platform built to enable teams to transform the way they develop, connect, and deploy applications, microservices, AI agents, and more.

With Orkes Conductor managed through Orkes Cloud, developers can focus on building mission critical applications without worrying about infrastructure maintenance to meet goals and, simply put, taking new products live faster and reducing total cost of ownership.

Try a 14-Day Free Trial of Orkes Conductor today.

Partner – Orkes – NPI EA (tag = Microservices)
announcement - icon

Modern software architecture is often broken. Slow delivery leads to missed opportunities, innovation is stalled due to architectural complexities, and engineering resources are exceedingly expensive.

Orkes is the leading workflow orchestration platform built to enable teams to transform the way they develop, connect, and deploy applications, microservices, AI agents, and more.

With Orkes Conductor managed through Orkes Cloud, developers can focus on building mission critical applications without worrying about infrastructure maintenance to meet goals and, simply put, taking new products live faster and reducing total cost of ownership.

Try a 14-Day Free Trial of Orkes Conductor today.

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

Partner – MongoDB – NPI EA (tag=MongoDB)
announcement - icon

Traditional keyword-based search methods rely on exact word matches, often leading to irrelevant results depending on the user's phrasing.

By comparison, using a vector store allows us to represent the data as vector embeddings, based on meaningful relationships. We can then compare the meaning of the user’s query to the stored content, and retrieve more relevant, context-aware results.

Explore how to build an intelligent chatbot using MongoDB Atlas, Langchain4j and Spring Boot:

>> Building an AI Chatbot in Java With Langchain4j and MongoDB Atlas

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

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