I am building a java application but, Everytime I want to export to jar file the terminal show this error and my jar file are not executable. However if I run from VS code it doesn't show any error. This are the error I got when I want to export to jar file
[WARNING] duplicate entry: module-info.class
In my launch.json{}
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "Launch SpaceInvaders",
"request": "launch",
"vmArgs": "--module-path C:/JavaJdk/javafx-sdk-17.0.1/lib --add-modules javafx.controls,javafx.fxml",
"mainClass": "Application.SpaceInvaders",
"projectName": "Space_a536e277"
},
{
"type": "java",
"name": "Launch SpaceShooter",
"request": "launch",
"mainClass": "Application.SpaceShooter",
"projectName": "Space_a536e277"
},
{
"type": "java",
"name": "Launch Current File",
"request": "launch",
"mainClass": "${file}"
},
{
"type": "java",
"name": "Launch App",
"request": "launch",
"mainClass": "Application.App",
"projectName": "Space_a536e277"
}
]
If I create module-info.java in my src file there is an error saying
module application {
requires javafx.controls;
requires javafx.fxml;
exports application;
}
javafx.controls cannot be resolved to a module