How to run Java programs from the terminal?

后端 未结 3 1904
情话喂你
情话喂你 2021-01-15 04:36

I am trying to run a Java program from my Terminal. I have Mac OS X 10.7.

teamL javac -jar kxml2-2.3.0.jar XMLHandler.java ServiceEndpoint.java TeamL.

3条回答
  •  情话喂你
    2021-01-15 04:37

    Have you added that jar to the classpath when you execute the program on the command line? e.g.

    java -classpath location_of_jar ...

提交回复
热议问题