Commit f5bcbb1
Register attach library under short name after loading by path
System.load() registers a library by its full path, not by short name.
When WindowsAttachProvider's static initializer later calls
System.loadLibrary("attach"), the JVM searches java.library.path and
fails because the standalone JRE bin/ has no attach.dll.
After loading by absolute path, extend java.library.path to include the
dll's parent directory, null ClassLoader.sys_paths to force a rescan,
then call System.loadLibrary("attach") to register the short name. Any
subsequent loadLibrary("attach") calls from WindowsAttachProvider then
find the name already registered and succeed.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent f4cc2a3 commit f5bcbb1
1 file changed
Lines changed: 30 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
152 | 153 | | |
153 | 154 | | |
154 | 155 | | |
155 | | - | |
156 | | - | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
157 | 185 | | |
158 | 186 | | |
159 | 187 | | |
0 commit comments