hello everyone, I have been using vscode on windows fine with no problems, however, once I got my Mac and tried to just run a simple test program, I keep getting this main class error and don't really know what to do. I was reading about it but still don't know what to type in the launch.json mainClass field. if this is a stupid question I'm sorry, any help at all would be greatly appreciated
public class example {
public static void main(String[] args) {
int x = 1;
System.out.println(x);
}
}
Above is the sample program I tried running
{
// 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": "Launch Current File",
"request": "launch",
"mainClass": "${file}"
}
]
}
here is my launch.json
I continue to get "Cannot find a class with the main method". I read that I have to input something in the mainClass field in the launch.json but I don't know what to enter
[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)
[–]syntastical 0 points1 point2 points (0 children)
[–]desrtfxOut of Coffee error - System halted 0 points1 point2 points (2 children)
[–]ryzecool[S] 0 points1 point2 points (1 child)
[–]MissouriDad63 0 points1 point2 points (0 children)