Embed both JAR and JRE into .exe

If Oracle’s licensing is a problem, OpenJDK is GPLv2 and is functionally (almost) identical to Oracle’s JRE (Oracle’s JRE is basically just a release build of OpenJDK). RedHat and Azul Systems provide prebuilt OpenJDK JREs which you can redistribute.

Edit: corrected misstatement about Oracle’s license.

And openjdk is the default on Linux distros, and work well. But it’s Goodyear to know…

AFAIK you are wrong.
Do you have some link to such information?

I think you can use javafxpackager to embed your JRE with your application.


In short; yes, you can.

 You may reproduce and distribute the Software (and also portions of Software identified below as Redistributable), provided that:

    you distribute the Software complete and unmodified and only bundled as part of Your applets and applications ("Programs"),
    your Programs add significant and primary functionality to the Software,
    your Programs are only intended to run on Java-enabled general purpose desktop computers and servers,
    you distribute Software for the sole purpose of running your Programs,
    you do not distribute additional software intended to replace any component(s) of the Software,
    you do not remove or alter any proprietary legends or notices contained in or on the Software,
    you only distribute the Software subject to a license agreement that protects Oracle's interests consistent with the terms contained in this Agreement, and
    you agree to defend and indemnify Oracle and its licensors from and against any damages, costs, liabilities, settlement amounts and/or expenses (including attorneys' fees) incurred in connection with any claim, lawsuit or action by any third party that arises or results from the use or distribution of any and all Programs and/or Software.

Still doesn’t mean that you should. My points remain:


This was in response to if redistributing the JRE was allowed, not whether you could package it inside the .exe or not.

1 Like

You are not allowed to redistribute the jdk though (I wanted its tools.jar for jit-compiling)

My mistake : you can, but you must check your licence is compliant with the Oracle’s one. So, IMHO, you can’t redistribute under some FLOSS licences (GPL for example) if you embed the JRE.

By the way, I’m not really sure you can bundle the JRE on the .exe

Le EULA says “complete and unmodified”. To me, bundling inside an exe sounds like a modification. Readme etc. are discarded or unavailable, for example.

Also Oracle provides a reccommended way to bundle apps with JRE. I would ask them if it is allowed or not.