How to set CLASSPATH in Linux to let java find jar file?

后端 未结 4 930
误落风尘
误落风尘 2021-01-07 14:40

Under Linux I am trying to run a jar file as follows:

java -jar plantuml.jar -testdot

while having CLASSPATH set to any of th

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-07 15:35

    You have to supply the complete path after the parameter -jar. So for your example you have to call

    java -jar /home/user/plantuml.jar -testdot
    

    The $CLASSPATH is only evaluated to find additional files (classes/resources) but not the jar file defined in the command line.

提交回复
热议问题