I have been searching for many similar posts about this but I still can\'t find my answer. I want to convert a .java program into a Linux executable file, without the .jar e
Another simple trick to convert a jar to a Linux executable is just putting a shebang before the jar file.
Say we have a hello.jar file.
$ java -jar hello.jar
hello world!
You can create an executable in following steps.
$ echo "#! /usr/bin/env java -jar" > hello
$ cat hello.jar >> hello
$ chmod +x hello
Then, you will be able to execute the hello file directly.
$ ./hello
hello world!