I have a big project that uses maven and I’m creating the project’s jar. The problems is that the project has several classes that can be executed. How can I accomplish this?
Every time that I try to execute a class I get this message
java -jar library.jar ExecutableClass1
Failed to load Main-Class manifest attribute from
library.jar
The manifest.mf file in your JAR can only have one Main-Class entry.
The jar would then by executed by running below.
If you have several “executables” that could be run then you can either pass command line parameters to the JAR and then run the correct code or you can generate multiple JAR files for each “executable”.