Can I run .jar file on Tomcat?

后端 未结 4 1268
不思量自难忘°
不思量自难忘° 2021-02-14 04:08

a very noob question. Can I run a .jar file on Tomcat. I am not building a web-app. I simply need to run a .jar with say HalloWorld in it. Is this possible/appropriate.

4条回答
  •  星月不相逢
    2021-02-14 04:14

    You can run a Java archive without Tomcat, simply with a Java Runtime Environment:

    $ java -jar myhelloworldapp.jar
    

    Tomcat is a servlet container, only needed for web applications.

提交回复
热议问题