How to Run Java Projects in IDEA 2021.3 Using WSL, SSH, and Docker
This article walks through configuring IntelliJ IDEA 2021.3 to run and debug Java applications on remote environments using WSL, SSH, and Docker, detailing the setup steps, required JDK configuration, and practical tips for seamless remote execution.
Introduction
After updating to IntelliJ IDEA 2021.3 I explored the new support for WSL, SSH and Docker, which allows running and debugging Java applications on remote environments without extensive configuration.
Key New Features
Space integration (not used in this tutorial)
Java 16 support (not needed for the examples)
Improved Git support
Windows taskbar support
Code With Me
WSL, SSH, Docker run targets
Running on WSL
Set up JDK and JAVA_HOME inside WSL, then create a new “WSL” Run/Debug configuration in IDEA. Choose the desired distribution; a green “successfully” indicates the target is ready. After that the project runs exactly like a local execution.
Running on SSH
Configure SSH credentials, create a new SSH Run Target, specify the remote directory and JAVA_HOME, then run or debug. Note that without rsync each execution uploads all class files and dependencies.
Running on Docker
Create a simple Dockerfile (e.g., FROM openjdk:11.0.11-oraclelinux7), add a Docker Run Target, select the local Docker server, and use the Dockerfile. After the container starts, IDEA shows the mapped port and the application runs normally.
Conclusion
With minimal configuration, WSL, SSH and Docker run targets behave like local execution, providing full Run and Debug capabilities. Upgrading to IDEA 2021.3 is recommended for developers who need these remote development features.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Java Backend Technology
Focus on Java-related technologies: SSM, Spring ecosystem, microservices, MySQL, MyCat, clustering, distributed systems, middleware, Linux, networking, multithreading. Occasionally cover DevOps tools like Jenkins, Nexus, Docker, and ELK. Also share technical insights from time to time, committed to Java full-stack development!
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
