every time I start my Java application, vscode asks me to specify the main Class for my java configuration, even though I already did it in launch.json. bit i believe what it's asking me is to choose a certain configuration to run from. so my question is:
is there a way to make a default Configuration to run from in launch.json?
this is my launch.json:
"configurations": [
{
"type": "java",
"name": "admin-ui",
"request": "launch",
"cwd": "${workspaceFolder}",
"console": "internalConsole",
"mainClass": "com.bla.blo.Application",
"projectName": "admin-ui",
If a class is kind of public and includes the function public static void main(String[] args), java extension will recognize it as mainClass and auto-complete it in launch.json.
About you saying:
vscode asks me to specify the main Class for my java configuration
It's may because when your debugging option is Current File ,you have more than one mainclass, so java extension will ask you to select one to run:

Anyway, the solution is selecting the option which name is in mainClass
configuration from the debug drop-down box on the left. From the configuration in your launch.json, you should choose admin-ui.
Here you can set the default launch configuration, then after that, you can use F5 to launch the default one.

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With