News for hackers. Stuff that matters.
Re:The JVM is not that heavy by derefr on Wednesday February 01, 2017 @03:00PM (#13544465)
> 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! :)

Re:The JVM is not that heavy by gregschlom on Wednesday February 01, 2017 @03:25PM (#13544732)
Funny 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.

Re:The JVM is not that heavy by mirekrusin on Thursday February 02, 2017 @07:57AM (#13550182)
Does java license interfere with this kind of setup?
Re:The JVM is not that heavy by merb on Friday February 03, 2017 @04:07AM (#13558686)
not when you bundle the openjdk
Re:The JVM is not that heavy by yoden on Wednesday February 01, 2017 @04:33PM (#13545469)
https://docs.oracle.com/javase/8/docs/technotes/guides/deplo...

Not only is it a short hop, it already exists :P

Re:The JVM is not that heavy by andor on Wednesday February 01, 2017 @04:42PM (#13545562)
Nice. Here's the manual page, the relevant flag is "-native":

http://docs.oracle.com/javase/8/docs/technotes/tools/unix/ja...

Re:The JVM is not that heavy by radicalbyte on Thursday February 02, 2017 @12:45AM (#13548405)
The problem with visiting that site is that Oracle have started litigating against users of their JVMs.

In that way the JVM can be "heavy".

Re:The JVM is not that heavy by pjmlp on Thursday February 02, 2017 @02:28AM (#13548791)
With 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.

Re:The JVM is not that heavy by geodel on Thursday February 02, 2017 @08:49AM (#13550433)
Oracle 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/...

Re:The JVM is not that heavy by pjmlp on Thursday February 02, 2017 @11:44AM (#13551915)
Quite 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.
Re:The JVM is not that heavy by andor on Wednesday February 01, 2017 @04:36PM (#13545502)
Avian [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/

[1] http://lafo.ssw.uni-linz.ac.at/papers/2015_CGO_Graal.pdf

Re:The JVM is not that heavy by marklgr on Thursday February 02, 2017 @02:06AM (#13548702)
> 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.

Re:The JVM is not that heavy by pjmlp on Thursday February 02, 2017 @02:27AM (#13548787)
It 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.
Re:The JVM is not that heavy by eru on Thursday February 02, 2017 @07:09AM (#13549956)
Careful there---it's a slippery slope all the way to unikernels.

https://mirage.io/

Re:The JVM is not that heavy by jjtheblunt on Wednesday February 01, 2017 @04:05PM (#13545167)
Isn't that _exactly_ what GoLang does for its binaries, insofar as shipping them statically linked?
Re:The JVM is not that heavy by dvlsg on Wednesday February 01, 2017 @04:14PM (#13545263)
dotnetcore has it as an option, as well.
Re:The JVM is not that heavy by mahmud on Wednesday February 01, 2017 @08:02PM (#13547114)
It's called "treeshaking", and is a classic option in Lisp delivery tools.
Re:The JVM is not that heavy by pjmlp on Thursday February 02, 2017 @02:30AM (#13548801)
Or virtual image pruning in Smalltalk tools.
Re:The JVM is not that heavy by hashhar on Thursday February 02, 2017 @08:36AM (#13550368)
.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.