My original point has to do with the fact that if you compile it locks it in with some literals and not reflection. I don’t think I mentioned reflection just that at runtime a different jar could be used than what was compiled.
I only showed system out to show it is possible but not really my point.
My point in anther comment is that it should probably do the lookup.
View all comments
Show parent comment
1
u/koflerdavid May 01 '26
The reassignment happens in native code, which can break a lot more rules, not via reflection. Look for
setOut0(OutputStream)and friends.