April 29, 2019

Running Main Java Class inside Spring Boot Jar Application

Assume that I have an application built using Spring Boot technology and I want to run a Java class "with main method" inside the boot jar file without running the boot application.

Assumptions:
- Spring Boot application jar name is "MyApp.jar"
- The Spring Boot starter class is "sawalha.boot.ApplicationStarter"
- The Java class with main method is "sawalha.stnd.NonSpringApplication"

To run  NonSpringApplication without running the whole Spring application is:

java -cp MyApp.jar -Dloader.main=sawalha.stnd.NonSpringApplication org.springframework.boot.loader.PropertiesLauncher

1 comment:

Anonymous said...

Bet365 Lotto Asia - Code: LEGALBET365.COM
Bet365 Lotto Asia. The amount of money that you can bet on can vary from the amount that you choose to place. What is the Bet365 app? How Do I 1xbet download Download a Bet365 Account?