We have absolutely no use for them at work. We have to explicitly suppress all module warnings and open up everything to everything in order to make commercial third-party Cipher implementations work.
Eventually we'll have to adopt them in order to make jlink work. The first engineer who volunteered to learn modules ended up desperately searching for another job and then leaving for it, all within about four months. Nobody else cares enough to slog through the mess; the trade-off currently doesn't bring us enough.
You don't need to modularise your codebase, but you will need to resolve issues regarding dependencies that hack into the JDK (you'll need to request the vendors of the cipher suites you're using to fix their problems) or explicitly allow them.
Hopefully by then we'll have moved to jlink, and can simply choose whatever JDK to bundle up into an executable.
If not, it's likely the project will just be abandoned. The churn of "must work around someone else's fuckery simply to keep the code running" but without ever seeing new benefits is just exhausting.
That's why encapsulation is important, and why the module system was added (among other reasons): To prevent libraries from tying themselves to specific implementation details and making your life hard, so that you won't have to work around their screwups anymore.
BTW, you don't need to modularise your app to use jlink.
To prevent libraries from tying themselves to specific implementation details and making your life hard, so that you won't have to work around their screwups anymore.
Yes, I realize that the future will be better. But the past is already here, and the future doesn't help us.
BTW, you don't need to modularise your app to use jlink.
That only means the executable includes the entirety of (what used to be called) the JRE, instead of the pieces of java.*/javax.* that we actually use. Our module-less experiment with jlink took 12 MB of class files and produced an .exe of nearly half a gigabyte.
That only means the executable includes the entirety of (what used to be called) the JRE
No, you can choose which modules to include in the runtime image. The difference is that if your application is modularised then this is done automatically, and if it isn't, you need to choose the modules manually (with --add-modules) but can use jdeps's --print-module-deps for assistance.
I know it says that on paper, but we got nothing but errors from jlink and jdeps. Googling the errors got us other people asking for help for the same things, and responses of "this is still new technology, wait for the next tools release".
I appreciate that you keep saying what should be possible, but right now it's been nothing but frustration and discouragement and a complete lack of useful up-to-date documentation. We just don't have the time or resources to fight through it blindly -- and I appreciate that no opensource project volunteers want to maintain or improve documentation in their limited free time, so I'm not looking for the docs to magically improve.
Maybe some future project of ours can use all these features from day one; I agree that sounds really pleasant.
and I appreciate that no opensource project volunteers
OpenJDK is open-source, but very few of the people working on it are volunteers. ~90% of the work is done by full-time Oracle engineers, and most of the rest is done by full-time engineers at Red Hat, SAP and some other companies. We may not have invested in the documentation as much as we'd like, but what, specifically, is missing here?
42
u/lukaseder Nov 21 '20
This is missing the simplest of all cheats: