mirror of
https://github.com/corda/corda.git
synced 2025-01-07 13:38:47 +00:00
set main thread context classloader correctly for OpenJDK port
sun.misc.Launcher has its own idea about what the application classloader should be, but we need to override it with the system classloader created by the VM. This is achieved by running Launcher.getLauncher (which has the side effect of setting Thread.contextClassLoader) and then overriding it.
This commit is contained in:
parent
c2b53497ab
commit
8c48a44e54
@ -623,6 +623,13 @@ class MyClasspath : public Classpath {
|
||||
t->m->processor->invoke
|
||||
(t, root(t, Machine::BootLoader), "java/lang/System",
|
||||
"initializeSystemClass", "()V", 0);
|
||||
|
||||
t->m->processor->invoke
|
||||
(t, root(t, Machine::BootLoader), "sun/misc/Launcher",
|
||||
"getLauncher", "()Lsun/misc/Launcher;", 0);
|
||||
|
||||
set(t, t->javaThread, ThreadContextClassLoader,
|
||||
root(t, Machine::AppLoader));
|
||||
}
|
||||
|
||||
virtual const char*
|
||||
|
Loading…
Reference in New Issue
Block a user