Question

Hi I have create a selenium test in eclipse java. There are two classes. Now I want to export project as jar and want to run two different classes.
But when I run java -jar myProject.jar

it run only one class that I have select as Launch configuration.

but I want to run another class that in jar.

java -jar myProject.jar testClass2

how to export jar file to achieve this.

Was it helpful?

Solution

Runable java files have a single main class. You will need to create an instance of your second class from the Main method of the start-up class.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top