Hacker News new | ask | show | jobs
by nicoburns 1549 days ago
> Also, Java 9 broke backward compatibility promise, and Java 17 broke it further by disabling a lot of default modules. Docker helps A/B testing multiple variation of JDK for our builds.

Does Java not have a version manager that lets you install multiple JDKs side-by-side and easily switch between them? For ecosystems I'm familiar with like Node.js and Rust this as is simple as a single command to install a given version and adding a text file with the required version to each repository(/directory) (it then gets used automatically when running code in that repo).

The answer for why not use Docker for development if you're using in production (on Windows/macOS) is that it's much slower. So the same reason that I have separate debug (fast compile time) and release (optimised) builds. If you're on Linux then Docker is great.

2 comments

Yes, in development mode, we use jenv: https://www.jenv.be/, that's how developers can switch between JDK.

But often times, our laptop don't have enough memory to perform the build and various tests. So we have to offload that to the CI/CD pipelines.

sdkman.io