'Run and Debug Java in WSL 2 with Intellij IDEA on Windows 10

Intellij IDEA is installed on Windows. The java application built with maven requires native libraries (with JNI) and runs on Ubuntu.

Using maven and git on Windows is fine. How can I point Intellij IDEA to use the JDK from WSL so I can create a run/debug configuration that uses the WSL?



Solution 1:[1]

Deploy your app on WSL with Power Shell, and remote debug

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 user10239343