Hacker News new | ask | show | jobs
by J-Kuhn 126 days ago
Such hacks will slowly stop working (without explicitly allowing it from the command line.)

In this example, it would throw an IllegalAccessException, because java.base doesn't open java.lang.

1 comments

Doesn’t field.setAccessible(true) already throw on a modern version?
Exactly.

You can make it not throw by adding `--add-opens java.base/java.lang=ALL-UNNAMED` or similar to the command line, but breaking things like this is becoming harder.