2 ms·
You can get <1KB with the appropriate compiler settings. (I am aware that you can get smaller binaries for other languages by changing the compiler settings to
by userbinator 10y ago
You can get <1KB with the appropriate compiler settings.
(I am aware that you can get smaller binaries for other languages by changing the compiler settings too, but I doubt any Java binary can reach that size even with the appropriate settings.)
- tokenizerrr 10y agoAnd what are you linking against, then? I can make a tiny .jar file as long as I get to completely ignore the size of the JDK, much like you're ignoring the size of the libraries you're linking against.
- diek 10y agoActually, funnily enough I just went through and built a semi-freestanding exe to load a jlink'd Java 9 JVM: https://gist.github.com/anonymous/cb6e81a36247563d423f36df19e41f9e https://gist.github.com/anonymous/cb6e81a36247563d423f36df19... The only dependencies this particular ex has is on user32.dll and kernel32.dll so it can call LoadLibrary and GetProcAddress, but if I wasn't interacting with those I could remove those dependencies (though then the exe wouldn't be able to do a whole lot of interesting things). If you look at the file in a hex editor, it's mostly just empty space as it just has four 1k sections with a little bit of data at the start of each.