How to Run a Specific Class Inside of a JAR

My friend wanted me to test out his program, but it didn’t have a main class specified in the manifest. Here’s the solution:

1
java  -cp yourjar.jar com.yourpackage.YourClass

This will run the specified class as the main class.

Source: StackOverflow


Thanks for reading my post! If you enjoyed it or it helped you, please consider liking/tweeting this page, commenting, or following me on GitHub or Twitter!