Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio code with Java environment in Docker Container

My question is, if I can run Java and Debug it from within Visual Studio Code. I can edit my code and then start it in a container. But is it also possible to run the docker container, having a volume with the code folder mounted into the container and then configure Visual Studio Code somehow to use Java from the container? I saw there is the .vscode folder with launch.json or settings.json, but I found no way so far to use the run/debug command and use Java from within the Docker container. I was looking for a way to use java 11 without breaking my current config.

like image 758
user934801 Avatar asked Jan 26 '26 05:01

user934801


1 Answers

Your best option really is to use the Remote Development extension pack for Visual Studio Code, and then use Docker containers.

See this sample for details.

like image 101
Bruno Borges Avatar answered Jan 28 '26 17:01

Bruno Borges



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!