Fix build system compatibility with JRuby.
Update NEWS.

[ci: skip]