Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot evaluate because of java.lang.IllegalStateException: Cannot evaluate, please specify projectName in launch.json #309

Open
lucian0c opened this issue Jul 16, 2020 · 1 comment

Comments

@lucian0c
Copy link

I cannot evaluate an expression in VSCode debugging tomcat.

I have this error.
cannot evaluate because of java.lang.IllegalStateException: Cannot evaluate, please specify projectName in launch.json..

My launch.json

{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "Debug (Launch) - Current File",
"projectName": "My API",
"request": "launch",
"mainClass": "${file}"
}
]
}

Environment
Operating System: Windows 10
JDK version: 11
Visual Studio Code version: 1.46.1
Java extension version: v0.9.1
Java Debugger extension version: v0.26.0
Is there anything else that i should change in my launch.json?

@codebling
Copy link

Right-click on a Java file (one without a main() function) and choose "Run Java" and you'll get a prompt with a few options. This prompt will show the project name.

pop-up menu when Java file is not executable

As you can see in this screenshot of this Ant project, sometimes the project name is unpredictable.

See also this answer on StackOverflow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants