CategoriesTips and Tricks

WSL2 as IntelliJ IDEA Run Target

Windows Subsystem for Linux (WSL) 2 provides a seamless Linux integration with many features. As developers, we can take full advantage of both OS at the same time.

WSL support on IntelliJ IDEA

For this example, I am using a Spring Boot project located in windows and run the project on a WSL2 Linux environment.

Add a spring boot run configuration as shown below and change the target to your Linux distribution.

Idea Run Configuration

Since this project is run on a JVM and build on Gradle, the Linux JDK and Gradle path should be configured as below.

Run Target Configuration

Now this “Run Configuration” can be used to run this spring boot application pointed to the Linux environment.

The following screen capture shows “Before” and “After” Linux processes in WSL and a new process has been added after using the above Intellij idea run configuration.

WSL2 Linux processes comparison

Leave a Reply

Your email address will not be published. Required fields are marked *