I downloaded an existing project that works fine in eclipse/intelliJ etc. I want to make it work in visual studio code. I have downloaded the various extensions that vscode suggests when opening a .java file, I have configured the launch.json file to find my main class etc. I press F5 to launch the application and the error I get is:
Error: Could not find or load main class pacman.Executor
Caused by: java.lang.ClassNotFoundException: pacman.Executor
This is not the only error I have gotten, before this error appeared, I got this problem:
build project cannot be resolved to a type
at some classes that I am using in the main method. This error seems to have just disappeared and I don't know whether I'm further away from solving the problems or closer to, I cannot replicate this error.
My launch.json looks like following:
"configurations": [
{
"type": "java",
"name": "Debug (Launch)-Executor",
"request": "launch",
"cwd": "${workspaceFolder}",
"console": "internalConsole",
"stopOnEntry": false,
"mainClass": "pacman.Executor",
"args": ""
}
]
I am afraid that the issue might have something to do with the classpath, but I have tried several things with this such as setting it directly in the launch.json to my jdk and jre without luck.
Also, currently I'm not using maven or anything like that - is that necessary in order to build the project from within vscode when using redhat java plugin?
I hope someone can help me with my confusion or have an idea what the problem might be about.
Thanks in advance.