Technically a jar file can contain more than one main class. When java executes a jar file, it looks in the META-INF/MANIFEST. MF file inside the jar to find the entrypoint. There is no direct command to get this information, but you can unpack the jar (it’s just a zip file) and look into the manifest yourself .
Read moreHow do you define main class in POM?
xml specify the main class in the manifest file. To add the main class info in manifest file we need to add maven-jar-plugin in pom. xml file and specify the main class info .23 Haz 2017
Read moreHow do you mention main class in manifest file?
It is simple.
Read moreHow do I run a java main class from the command line?
How to run a java program
Read moreHow do I add a class to a JAR file?
Show activity on this post.
Read moreHow do I run a JAR file in main class?
To run an application in a nonexecutable JAR file, we have to use -cp option instead of -jar. We’ll use the -cp option (short for classpath) to specify the JAR file that contains the class file we want to execute: java -cp jar-file-name main-class-name [args …] 4 Şub 2022
Read moreHow do I run a java JAR file?
jar, follow these rules:
Read more