'VSCode for Play framework using Java and Sbt (Scala) on WSL
I have been trying to setup a 'Play Framework' code base on my Visual Studio Code. The code is written in Java and uses Sbt(Scala) to download references/packages, compile and run. I have installed the 'Java extension pack' and the 'Sbt plugin' by lightbend on VsCode. The 'sbt compile' and 'sbt run' runs fine and I am able to run the application using
"sbt -jvm-debug 5005 'run 9001'"
I have the following in my launch.json to attach to this process
"configurations": [
{
"type": "java",
"name": "Debug (Attach) - Remote",
"request": "attach",
"hostName": "localhost",
"port": 5005
}]
The process attaches and the breakpoints are hit. However, I am not able to inspect any of the variables/statements. Please refer error below
Cannot evaluate because of compilation error(s): form cannot be resolved. None of the references are resolved
Solution 1:[1]
I know it has been a long time since the question has been asked but I just wanted to share what worked for me.
This seems to be a problem with the project setup in Visual Studio Code and not necessarily a problem with the Debug configuration. I setup the Play Framework project in VSC as it is explained here (especially the changes in the pom.xml file) and it worked great for me. I was even able to run the application in Debug mode and evaluate the variables just fine.
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 | A Lopes |


