How to run a jar file in a linux commandline

前端 未结 6 2018
野趣味
野趣味 2021-01-30 08:44

How to set the classpath to the current directory and also run the jar file named load.jar present in the current directory by providing the argument as load=

6条回答
  •  没有蜡笔的小新
    2021-01-30 09:10

    copy your file in linux Java directory

    cp yourfile.jar /java/bin
    

    open the directory

    cd /java/bin
    

    and execute your file

    ./java -jar yourfile.jar

    or all in one try this command:

    /java/bin/java -jar jarfilefolder/jarfile.jar

提交回复
热议问题