Can I compile a Java App to a single binary that runs on Linux?

1.5k Views Asked by At

There shouldn't be any additional requirements to configure a JRE or JAVA_HOME and all that. I'd like to bundle a jre (ideally the IBM JRE) within the binary.

I've looked at the following tools:

JWrapper: Seems to require a splash screen which I don't need because I'm developing a console application

packr: Doesn't seem to work with the IBM JRE only the Oracle and OpenJDK ones.

Jar2Exe: Doesn't seem to work with the IBM JRE either.

Everything else seems to only work for windows.

Are there any other tools I'm not aware of? Should packer and Jar2EXE actually work with the IBM JRE but I'M doing something wrong?

1

There are 1 best solutions below

3
On

Try Excelsior JET. I'm not sure about IBM JRE (there is a thread about it), but it works perfectly with Oracle JRE and OpenJDK.