RFD: What do we do about programs which set sys_paths to null?

Andrew Haley aph at redhat.com
Tue Apr 21 15:19:55 UTC 2020


On 4/21/20 4:10 PM, Langer, Christoph wrote:

> what's your status on this? Can we expect you to bring this fix in
> for 11.0.8 and 8u262?
>
> For 11u, we haven't backed out JDK-8231584 yet. So I'd like to
> either see your fix going in or to have a decision about a
> backout. Maybe in 11u we can also live with the backport of the
> upstream patch... I'm not sure.

Jeez, I dunno. Every option I can think of is horrible.

If I had to guess, I'd say that what we have now is the least bad. 8u
continues to work, and the people making the jump to 11 will perhaps
find the workarounds they need.

But some of the workarounds people use instead of setting sys_paths to
null are even worse. Like this one:

   final Field fieldUsrPaths = ClassLoader.class.getDeclaredField("usr_paths");
   fieldUsrPaths.setAccessible(true);
   fieldUsrPaths.set(System.class.getClassLoader(), usr_paths);

This will work in 8u. Maybe we should add a test case to 8u to that we
check that both this and the sys_paths-to-null hack keep working.

I think that we'd better keep 11 as it is, in the hope that people
transitioning to 8 will also transition to fixing the code.

-- 
Andrew Haley  (he/him)
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
https://keybase.io/andrewhaley
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671



More information about the jdk8u-dev mailing list