I know the default way of calling a jar file from terminal
java -jar myapp.jar
I want to call the app from terminal by the name myapp
. I know its possible to call a shell script from terminal by this method if the script is kept in /usr/bin/
(And of course the .sh
extension is removed)
Can this be achieved with jar files? I don't wish to set aliases. I wanted to do this specifically by calling from bin
directory.
Edit: If its possible to call by something like java appname
, that shall also be helpful.
Edit: I have checked the usage of linux gcj
as Michael Aaron Safyan redirected me in comments. But gcj
is said to be obsolete for years and is no longer an industry standard.
Can this be achieved by creating a jad file and calling something like jad myapp
from terminal?