<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Adding new paths for native libraries at runtime in Java</title>
	<atom:link href="http://blog.sibvisions.com/2020/05/22/adding-new-paths-for-native-libraries-at-runtime-in-java/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.sibvisions.com/2020/05/22/adding-new-paths-for-native-libraries-at-runtime-in-java/</link>
	<description>Blog @ SIB Visions</description>
	<lastBuildDate>Wed, 05 Mar 2025 13:10:49 +0100</lastBuildDate>
		<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: rjahn</title>
		<link>https://blog.sibvisions.com/2020/05/22/adding-new-paths-for-native-libraries-at-runtime-in-java/comment-page-1/#comment-751</link>
		<dc:creator>rjahn</dc:creator>
		<pubDate>Mon, 09 Sep 2024 12:17:32 +0000</pubDate>
		<guid isPermaLink="false">https://blog.sibvisions.com/?p=8354#comment-751</guid>
		<description>Check: https://blog.sibvisions.com/2024/09/09/adding-new-paths-for-native-libraries-at-runtime-in-java-part-2/</description>
		<content:encoded><![CDATA[<p>Check: <a href="https://blog.sibvisions.com/2024/09/09/adding-new-paths-for-native-libraries-at-runtime-in-java-part-2/" rel="nofollow">https://blog.sibvisions.com/2024/09/09/adding-new-paths-for-native-libraries-at-runtime-in-java-part-2/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rjahn</title>
		<link>https://blog.sibvisions.com/2020/05/22/adding-new-paths-for-native-libraries-at-runtime-in-java/comment-page-1/#comment-732</link>
		<dc:creator>rjahn</dc:creator>
		<pubDate>Mon, 04 Jan 2021 12:56:36 +0000</pubDate>
		<guid isPermaLink="false">https://blog.sibvisions.com/?p=8354#comment-732</guid>
		<description>Not really! It works up to Java 14 in our tests.

The problem is that they changed the internal handling of sys path... and it was their intention to prevent this &quot;hack&quot;.
We&#039;ll try to find a solution but right now, it won&#039;t work with Java &gt; 15.</description>
		<content:encoded><![CDATA[<p>Not really! It works up to Java 14 in our tests.</p>
<p>The problem is that they changed the internal handling of sys path... and it was their intention to prevent this "hack".<br />
We'll try to find a solution but right now, it won't work with Java &gt; 15.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kris Kristensen</title>
		<link>https://blog.sibvisions.com/2020/05/22/adding-new-paths-for-native-libraries-at-runtime-in-java/comment-page-1/#comment-731</link>
		<dc:creator>Kris Kristensen</dc:creator>
		<pubDate>Mon, 04 Jan 2021 12:52:22 +0000</pubDate>
		<guid isPermaLink="false">https://blog.sibvisions.com/?p=8354#comment-731</guid>
		<description>any luck so far...?</description>
		<content:encoded><![CDATA[<p>any luck so far...?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rjahn</title>
		<link>https://blog.sibvisions.com/2020/05/22/adding-new-paths-for-native-libraries-at-runtime-in-java/comment-page-1/#comment-730</link>
		<dc:creator>rjahn</dc:creator>
		<pubDate>Sat, 19 Dec 2020 13:25:59 +0000</pubDate>
		<guid isPermaLink="false">https://blog.sibvisions.com/?p=8354#comment-730</guid>
		<description>Bad news, but maybe only because the class structure has changed.... I&#039;ll check both problems tomorrow.... Hopefully there&#039;s a possibility to enable this again.</description>
		<content:encoded><![CDATA[<p>Bad news, but maybe only because the class structure has changed.... I'll check both problems tomorrow.... Hopefully there's a possibility to enable this again.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kris Kristensen</title>
		<link>https://blog.sibvisions.com/2020/05/22/adding-new-paths-for-native-libraries-at-runtime-in-java/comment-page-1/#comment-729</link>
		<dc:creator>Kris Kristensen</dc:creator>
		<pubDate>Sat, 19 Dec 2020 11:06:58 +0000</pubDate>
		<guid isPermaLink="false">https://blog.sibvisions.com/?p=8354#comment-729</guid>
		<description>With JDK 15.01 it becomes even worse. Now usr_paths are reflected as not even being part of the ClassLoader class:

java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
	at com.foo.bar.(NativeLoader.java:48)
Caused by: java.lang.NoSuchFieldException: no such field: java.lang.ClassLoader.usr_paths/[Ljava.lang.String;/getStatic
	at java.base/java.lang.invoke.MemberName.makeAccessException(MemberName.java:980)
	at java.base/java.lang.invoke.MemberName$Factory.resolveOrFail(MemberName.java:1117)
	at java.base/java.lang.invoke.MethodHandles$Lookup.resolveOrFail(MethodHandles.java:3424)
	at java.base/java.lang.invoke.MethodHandles$Lookup.findStaticVarHandle(MethodHandles.java:3024)
	... 5 more
Caused by: java.lang.NoSuchFieldError: usr_paths
	at java.base/java.lang.invoke.MethodHandleNatives.resolve(Native Method)
	at java.base/java.lang.invoke.MemberName$Factory.resolve(MemberName.java:1087)
	at java.base/java.lang.invoke.MemberName$Factory.resolveOrFail(MemberName.java:1114)
	... 7 more</description>
		<content:encoded><![CDATA[<p>With JDK 15.01 it becomes even worse. Now usr_paths are reflected as not even being part of the ClassLoader class:</p>
<p>java.lang.reflect.InvocationTargetException<br />
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br />
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)<br />
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)<br />
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)<br />
	at com.foo.bar.(NativeLoader.java:48)<br />
Caused by: java.lang.NoSuchFieldException: no such field: java.lang.ClassLoader.usr_paths/[Ljava.lang.String;/getStatic<br />
	at java.base/java.lang.invoke.MemberName.makeAccessException(MemberName.java:980)<br />
	at java.base/java.lang.invoke.MemberName$Factory.resolveOrFail(MemberName.java:1117)<br />
	at java.base/java.lang.invoke.MethodHandles$Lookup.resolveOrFail(MethodHandles.java:3424)<br />
	at java.base/java.lang.invoke.MethodHandles$Lookup.findStaticVarHandle(MethodHandles.java:3024)<br />
	... 5 more<br />
Caused by: java.lang.NoSuchFieldError: usr_paths<br />
	at java.base/java.lang.invoke.MethodHandleNatives.resolve(Native Method)<br />
	at java.base/java.lang.invoke.MemberName$Factory.resolve(MemberName.java:1087)<br />
	at java.base/java.lang.invoke.MemberName$Factory.resolveOrFail(MemberName.java:1114)<br />
	... 7 more</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kris Kristensen</title>
		<link>https://blog.sibvisions.com/2020/05/22/adding-new-paths-for-native-libraries-at-runtime-in-java/comment-page-1/#comment-728</link>
		<dc:creator>Kris Kristensen</dc:creator>
		<pubDate>Sat, 19 Dec 2020 08:33:21 +0000</pubDate>
		<guid isPermaLink="false">https://blog.sibvisions.com/?p=8354#comment-728</guid>
		<description>Hi,

This is just brillant, thanks a tonn! - however there is a little curveball to this. It won&#039;t wotk with java 13 unfortunately. Check my stacktrace below. 

If you could make it java 13 compliant, that would be highly appreciated. Thanks again.

Stacktrace from java 13 (openjdk):
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access using Lookup on com.foo.bar.NativeLoader (file:/classes/) to class java.lang.ClassLoader
WARNING: Please consider reporting this to the maintainers of com.foo.bar.NativeLoader
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Exception in thread &quot;main&quot; java.lang.ExceptionInInitializerError
Caused by: java.lang.NullPointerException

The NPE is the saPath from your example being null. I guess it would be oodd for usr_paths to be null, so I guess reflection filetered it away.</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>This is just brillant, thanks a tonn! - however there is a little curveball to this. It won't wotk with java 13 unfortunately. Check my stacktrace below. </p>
<p>If you could make it java 13 compliant, that would be highly appreciated. Thanks again.</p>
<p>Stacktrace from java 13 (openjdk):<br />
WARNING: An illegal reflective access operation has occurred<br />
WARNING: Illegal reflective access using Lookup on com.foo.bar.NativeLoader (file:/classes/) to class java.lang.ClassLoader<br />
WARNING: Please consider reporting this to the maintainers of com.foo.bar.NativeLoader<br />
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations<br />
WARNING: All illegal access operations will be denied in a future release<br />
Exception in thread "main" java.lang.ExceptionInInitializerError<br />
Caused by: java.lang.NullPointerException</p>
<p>The NPE is the saPath from your example being null. I guess it would be oodd for usr_paths to be null, so I guess reflection filetered it away.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
