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.

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top