0

I have a util class which has a main method. After packaged by Boot Maven plugin, it ends up in BOOT-INF/classes. It does need some other libraries packaged under BOOT-INF/lib. Is there a quick way using the cmdline to run that program, without unzip the jar? Thanks!

Nathan W
  • 401
  • 6
  • 17
  • Is that main class the spring boot's main class? Or other? – acdcjunior Mar 11 '18 at 00:45
  • 1
    If is an executable jar and the dependencies are specified in the manifest or inside the jar just use, java -jar myjar.jar. See this question https://stackoverflow.com/questions/18413014/run-a-jar-file-from-the-command-line-and-specify-classpath – Jose Da Silva Mar 11 '18 at 00:57
  • No, it's my own class, and is not specified in the manifest. – Nathan W Mar 11 '18 at 01:09
  • You can use command like `java -cp myjar.jar MyMainClass`. – ELITE Mar 11 '18 at 04:42

0 Answers0