0

I am developing an app that takes arguments like usual command. For example -h option prints help like this:

pi@raspberrypi:~ $ java -jar my.jar -h usage: My App -d,--download-to <arg> Download path -h,--help Shows this help 

I am wondering if it is possible to run jar file from command line without using java -jar prefix?

Like this:

pi@raspberrypi:~ $ my.jar -h usage: My App -d,--download-to <arg> Download path -h,--help Shows this help 
2
  • 2
    You could create a batch file and run that instead. Commented May 8, 2016 at 6:38
  • 1
    you could use spring-boot when you build your app and configure the spring-boot-maven-plugin to create a ‘fully executable’ jar, docs.spring.io/spring-boot/docs/current/reference/html/… Commented May 8, 2016 at 9:21

1 Answer 1

2

Try set command alias: alias myjar='java -jar my.jar'

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.