I have a bunch of java command-line programs I've written and would like to install for all users.
Building with NetBeans, I get a
/dist directory which contains
myprog1.jar and a
/libs directory with all the necessary libraries. The usual method to run is to go there and
java -jar my.jar -options.
So what I'd like to do is just type
myprog1 -options from anywhere and have it run.
The method I have thought of is:
- Create a bash script
/usr/local/binwhich simply redirects all of the command line args to
java -jar /opt/myjava/myprog1/myprog1.jar
I'm not too keen on bash scripting... if this is a reasonable method, what would that script look like, given that each program has a variable number and order of arguments? Does the script have to also worry about standard Unix bits such as output redirect
> and pipes