How to call method in jar file with terminal?

后端 未结 4 684
粉色の甜心
粉色の甜心 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:47

    You can not call any method from terminal or cmd of any class.

    You can execute class through terminal.

    If your jar is executable try: java -jar "Name of your Jar"

    Or set the class path of your jar: java -classpath path-to-jar .

提交回复
热议问题