4

What is the difference between starting java process by:

java -jar application.war

and

java -classpath application.war org.example.Main

Problem is that I'm starting Spring Boot Application with -jar argument, process starts normally, but in eclipse application starts with exception:

Caused by: java.lang.ClassNotFoundException: com.sun.istack.localization.Localizable
kris14an
  • 741
  • 7
  • 24

1 Answers1

6

When you launch your app with

java -jar application.war

It will read your MANIFEST.MF and pick up your classpath from there, including presumably your missing com.sun.istack.localization.Localizable.

When you specify the classpath as the war, it finds your Main class but does not include the values from the MANIFEST.MF.

Evan Knowles
  • 7,426
  • 2
  • 37
  • 71