6 ms·
> I wrote a simple tool that allows you to filter out what you don't need It'd be a short hop from here to a tool that basically does for JDK-platform apps wha
by derefr 10y ago
> I wrote a simple tool that allows you to filter out what you don't need
It'd be a short hop from here to a tool that basically does for JDK-platform apps what Erlang's releases do for the ERTS platform: builds a new JRE (as a portable executable, not an installer) that actually contains the app and its deps in the JRE's stdlib, such that you just end up with a dir containing "a JRE", plus a runtime "boot config" file that tells the JRE what class it should run when you run the JRE executable.
With such a setup, your Java program could actually ship as an executable binary, rather than a jar and an instruction to install Java. Nobody would have to know Java's involved! :)
- gregschlom 10y agoFunny you mention that, that's exactly why we wrote this tool. We were having a ton of support issues with our Windows users having to install Java, incompatible Java versions, needing admin privileges to install the JRE, etc... We fixed this whole class of issues by doing exactly what you suggest: bundling the JRE and writing our own launcher binary.
- mirekrusin 10y agoDoes java license interfere with this kind of setup?
- merb 10y agonot when you bundle the openjdk
- jjtheblunt 10y agoIsn't that _exactly_ what GoLang does for its binaries, insofar as shipping them statically linked?
- yoden 10y agohttps://docs.oracle.com/javase/8/docs/technotes/guides/deploy/packager.html https://docs.oracle.com/javase/8/docs/technotes/guides/deplo... Not only is it a short hop, it already exists :P
- andor 10y agoNice. Here's the manual page, the relevant flag is "-native": http://docs.oracle.com/javase/8/docs/technotes/tools/unix/javapackager.html http://docs.oracle.com/javase/8/docs/technotes/tools/unix/ja...
- radicalbyte 10y agoThe problem with visiting that site is that Oracle have started litigating against users of their JVMs. In that way the JVM can be "heavy".
- pjmlp 10y agoWith users that use commercial features without paying for them. It is quite easy to know which features those are when they require a flag named -XX:+UnlockCommercialFeatures, you just don't use them by mistake.
- geodel 10y agoOracle gives free license to use commercial features in development[1] in section B. It is very easy to some script for JVM startup parameters and get that script deployed in production by mistake. 1. http://www.oracle.com/technetwork/java/javase/terms/license/index.html http://www.oracle.com/technetwork/java/javase/terms/license/...
- pjmlp 10y agoQuite right, but unless I am too cynical I doubt those deployments were actually done by mistake, when I relate how many companies try to "alleviate" their costs.
- andor 10y agoAvian [0] is an embeddable VM in the way you suggest, I haven't used it though. In the future, we'll hopefully have the Substrate VM [1] for Java and other Truffle-supported languages. It's embeddable and also does reachability analysis to exclude unused library code. For now, it seems to be closed source. [0] http://readytalk.github.io/avian/ http://readytalk.github.io/avian/ [1] http://lafo.ssw.uni-linz.ac.at/papers/2015_CGO_Graal.pdf http://lafo.ssw.uni-linz.ac.at/papers/2015_CGO_Graal.pdf
- marklgr 10y ago> what Erlang's releases do for the ERTS platform That's the difference between an industrial-strength platform like Erlang, and a dev-centric deployment nightmare like Python. Java is normally on the enterprise side of the spectrum, but unfortunately it didn't get deployment right for quite a long time, even though it appears it's getting there lately.
- pjmlp 10y agoIt started on Java 8 with adoption of having a packing story as part of the JDK tooling, but I don't know how good it is.
- eru 10y agoCareful there---it's a slippery slope all the way to unikernels. https://mirage.io/ https://mirage.io/
- hashhar 10y ago.NET Core does have this and allows distributing the runtime, your classes as a standalone executable. It is obviously larger than just the class files and dlls but works great for portability.