[JAVA] A tool that makes a standalone jar an executable file

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.

Introduction of tools

jarexe A tool that generates an executable file from a jar file. It is implemented in Go.

https://github.com/katsuyan/jarexe

Installation

go get github.com/katsuyan/jarexe

Or do a git clone and do a go build.

How to use

jarexe ~.jar

Doing the above will generate an executable with the name of the jar file without the .jar.

option

Each option can be confirmed with the following command.

jarexe -h

change name

jarexe ~.jar --name ...

You can change the name of the generated executable file by adding the name option.

Add java option

jarexe ~.jar --jop "-Xmn120m -Xmx480m -Xms480m"

It is possible to add java options for the example above.

What are you doing

All I'm doing is merging the code that calls my own file with java -jar and the contents of the jar.

↓ Image

スクリーンショット 2017-12-05 21.21.06.png

reference

https://coderwall.com/p/ssuaxa/how-to-make-a-jar-file-linux-executable

Recommended Posts

A tool that makes a standalone jar an executable file
Create an executable file in a scripting language
I made a tool that makes decompression a little easier with CLI (Python3)
I made a package to create an executable file from Hy source code
I made a tool in Python that right-clicks an Excel file and divides it into files for each sheet.
[Python] A tool that allows intuitive relative import
A script that just gets an RSS feed
Create a GUI executable file created with tkinter
Create an exe file that works in a Windows environment without Python with PyInstaller
File overwrite confirmation with option that takes a file object as an argument with Python argparse
How to use NUITKA-Utilities hinted-compilation to easily create an executable file from a Python script