How to run a jar file in a linux commandline

前端 未结 6 1964
野趣味
野趣味 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 08:54

    Under linux there's a package called binfmt-support that allows you to run directly your jar without typing java -jar:

    sudo apt-get install binfmt-support
    chmod u+x my-jar.jar
    ./my-jar.jar # there you go!
    

提交回复
热议问题