Reputation: 49329
How can i bundle a stripped down JVM to run just my application?
i would like to strip down the JVM so that i can include it in my application. I know that exe wrappers can do this but what i would like to know is how? so that i can script it and create bundles for multiple OS's not just Windows.
Upvotes: 2
Views: 3078
Reputation: 48824
For the vast majority of users (that is to say those who have a Java runtime installed) you shouldn't need to distribute your own custom execution environment, and in fact doing so goes against the "spirit" of Java.
Java code is designed to be runnable in any environment, and you can easily replicate the double-click-and-run behavior of an .exe
with a Java program by creating an executable .jar
.
This may not be quite the answer you're looking for, and if so the answers discussing licensing stripped-down JVMs are what you need. But most Java developers should have no need to jump through such hoops. Simply distribute your Jars and let users install a Java runtime themselves.
Upvotes: -1
Reputation: 114767
Even though it might be possible to strip down the JRE distribution from a technical perspective, please have a close look at the license agreement. For Java 6 it states:
[...] Sun grants you a non-exclusive, non-transferable, limited license without fees to reproduce and distribute the Software, provided that (i) you distribute the Software complete and unmodified and only bundled as part of, and for the sole purpose of running, your Programs [...] {Supplemental License Terms, (B)}
I'd read it like that: you're only allowed to distribute a complete (Sun) JRE 6 (or JDK 6).
Upvotes: 3