I have a simple class with a main method. This is not my main class in the application but a tool. I want to run it like
java -cp mySpringBoot.jar com.pkg1.pkg2.pkg3.mytool
I can see that this class is in there in the same package but under BOOT-INF/classes/com/pkg1/pkg2/pkg3/mytool.class
I tried using the BOOT-INF/classes
folder as well but it keeps saying
Error: Could not find or load main class ... com.pkg1.pkg2.pkg3.mytool
Edit:
My tool class that is inside the spring boot jar is very simple, it is not in the same package as the root where my SpringBootApplication class resides.
package com.comp.mypackage.tools;
//imports
public class MyTool{
public static void main (String args[]) {
......
}
}