W
W
WenSiL2018-07-17 13:49:35
Java
WenSiL, 2018-07-17 13:49:35

Why won't the Java debugger start in VS Code?

There is this java code:

class Example {
    public static void main(String args[]) {
        System.out.println("gg");
    }
}

And this launch.json:
{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "java",
            "name": "Launch",
            "request": "launch",
            "mainClass": "Example"
        }
    ]
}

But when I try to start debugging, I get an error

Error: Could not find or load main class Example
Caused by: java.lang.ClassNotFoundException: Example

What to do with it? I tried reinstalling JDK, I also reinstalled plug-ins for vs code (Java Extension Pack), to no avail.
PS: I managed to solve the problem simply by renaming the folder, but is there a more adequate way to solve the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sergey, 2018-12-16
kuzmin @sergueik

not use vscode ? there is also idea and eclipse with netbeans

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question