Java - (Main|Start) Class

> Procedural Languages > Java

1 - About

Language - (Main|Application Entry point) in Java is called a Main class.

The (Main|Start) class is a class that:

Advertising

3 - Management - Execution

3.1 - Java

java -jar myJar.jar  com.package.myMainClass arg1 arg2

3.2 - Jar and Manifest file

In a manifest file of a runnable jar

manifest
Manifest-version: 1.0
Main-Class: HelloWorld

Code:

java -jar myStartableJar.jar

3.3 - maven

mvn package exec:java -Dexec.mainClass=package.Class

3.4 - Eclipse

lang/java/main_class.txt · Last modified: 2019/11/12 14:54 by gerardnico