How to call method in jar file with terminal?

后端 未结 4 650
粉色の甜心
粉色の甜心 2021-01-17 16:34

I have a compiled project in a jar file and I need to call a method from it.How can I do that in ubuntu terminal?

4条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-17 16:51

    java -cp path/to/jar .
    

    example:

    java -cp test.jar org.dekz.HelloWorld
    

提交回复
热议问题