0

I have a spring application with Java, i need to run specific main class of a jar with program argument i tried to search for a solution but could not find one i also need to pass program argument to the argsp[] in the main method of my class

this was similar but didn't help

CMD ["java","-jar","/usr/local/jetty/myjar-0.0.1-SNAPSHOT.jar","com.company.migrate.db.build.MyMainClass","/var/lib/jetty/resources/"]

but when I run my docker I get this error

no main manifest attribute, in /usr/local/jetty/myjar-0.0.1-SNAPSHOT.jar

I tried also this command

CMD ["java","-jar","/usr/local/jetty/myjar-0.0.1-SNAPSHOT.jar","-Dexec.mainClass=com.company.migrate.db.build.MyMainClass","/var/lib/jetty/resources/"]

Tried also running this command from the container

java -jar -Dloader.main=/usr/local/jetty/myjar-0.0.1-SNAPSHOT.jar com.company.migrate.db.build.MyMainClass 

But i get:

Error: Unable to access jarfile com.company.migrate.db.build.MyMainClass
Barak Kedem
  • 784
  • 7
  • 22

0 Answers0