News for hackers. Stuff that matters.
Re:Java 22 Released by chungy on Tuesday March 19, 2024 @05:24PM (#39760386)
Java 8 allows access to unsafe methods, which despite being meant for internal JDK use only, have been widely used in external projects. Newer Java versions do not permit the use of unsafe except for the JDK itself.

It wasn't ever part of the public API that's promised to never break, and JDK developers were annoyed that it being used meant Java got perceived as unstable, and it's gone in more recent versions.

Re:Java 22 Released by cempaka on Tuesday March 19, 2024 @08:34PM (#39761801)
I thought the issue was not Unsafe methods (which are only just now starting to be marked for removal) but rather various bytecode weaving libraries like javassist. As the JDKs progressively enforce bytecode verification more strictly these libraries sometimes run afoul of the new restrictions. (I speak from a little experience here, managed a somewhat involved upgrade path from 7 to 8 way back in the day which had this issue.)
Re:Java 22 Released by chungy on Tuesday March 19, 2024 @09:41PM (#39762158)
That's probably another factor, and these two aren't the only ones.
Re:Java 22 Released by vips7L on Wednesday March 20, 2024 @12:47AM (#39762930)
I haven’t ever seen this mentioned. The real culprit was libraries that go into jdk internals when they shouldn’t have so end user applications couldn’t upgrade until those libraries upgraded.
Re:Java 22 Released by marginalia_nu on Tuesday March 19, 2024 @10:32PM (#39762396)
Huh, but I'm using Unsafe in JDK 21?