There are many JVM languages, and each build tool can be grouped into a standalone jar. However, writing java -jar ~ .jar
or creating a shell script every time is annoying. Therefore, I made a tool to make jar an executable file with a single command. This article is the 6th day article of VASILY Advent Calendar 2017.
jarexe A tool that generates an executable file from a jar file. It is implemented in Go.
https://github.com/katsuyan/jarexe
go get github.com/katsuyan/jarexe
Or do a git clone and do a go build
.
jarexe ~.jar
Doing the above will generate an executable with the name of the jar file without the .jar
.
Each option can be confirmed with the following command.
jarexe -h
jarexe ~.jar --name ...
You can change the name of the generated executable file by adding the name
option.
jarexe ~.jar --jop "-Xmn120m -Xmx480m -Xms480m"
It is possible to add java options for the example above.
All I'm doing is merging the code that calls my own file with java -jar
and the contents of the jar.
↓ Image
https://coderwall.com/p/ssuaxa/how-to-make-a-jar-file-linux-executable