A couple people have asked “Why is it hard to manage a local Java installation?”
When I worked on open-source projects written in Java, a big source of bug reports was users who had set up their JDK wrong and needed help. Bazel-team now distributes a binary with an embedded JDK because people had so many issues.
Some cases we saw, that I remember off the top off my head:
- One version of the JRE installed but a different version of the JDK, and they interfered with each other in unpredictable ways
- Botched version upgrades
- Multiple JDKs installed by different package managers that interacted in weird ways. This was a particular problem on MacOS due to Apple/Java politics that I don’t totally understand
But the big problem is that when you have a broken Java install, Java does not do a good job of detecting and surfacing that. The error messages are often cryptic, and make it sound like the program you’re trying to run has problems.