<?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: JNI (Java Native Interface): Exception in thread &#8220;main&#8221; java.lang.UnsatisfiedLinkError: Can&#8217;t find dependent libraries</title>
	<atom:link href="http://witte-consulting.com/blog/jni-java-native-interface-exception-in-thread-main-javalangunsatisfiedlinkerror-can-t-find-dependent-libraries/feed/" rel="self" type="application/rss+xml" />
	<link>http://witte-consulting.com/blog/jni-java-native-interface-exception-in-thread-main-javalangunsatisfiedlinkerror-can-t-find-dependent-libraries/</link>
	<description>Brief articles by Kai Witte</description>
	<pubDate>Sat, 13 Mar 2010 06:04:15 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Kai Witte</title>
		<link>http://witte-consulting.com/blog/jni-java-native-interface-exception-in-thread-main-javalangunsatisfiedlinkerror-can-t-find-dependent-libraries/comment-page-1/#comment-542</link>
		<dc:creator>Kai Witte</dc:creator>
		<pubDate>Tue, 09 Mar 2010 14:45:14 +0000</pubDate>
		<guid isPermaLink="false">http://witte-consulting.com/blog/?p=141#comment-542</guid>
		<description>hello Franklin,

I'd say either the native binary is not found or it doesn't contain what you need.

Did you compile it with gcc --add-stdcall-alias? Did you check out which functions the binary contains? Did it contain sendechotohost? Is it in the runtime PATH?</description>
		<content:encoded><![CDATA[<p>hello Franklin,</p>
<p>I&#8217;d say either the native binary is not found or it doesn&#8217;t contain what you need.</p>
<p>Did you compile it with gcc &#8211;add-stdcall-alias? Did you check out which functions the binary contains? Did it contain sendechotohost? Is it in the runtime PATH?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: franklin</title>
		<link>http://witte-consulting.com/blog/jni-java-native-interface-exception-in-thread-main-javalangunsatisfiedlinkerror-can-t-find-dependent-libraries/comment-page-1/#comment-541</link>
		<dc:creator>franklin</dc:creator>
		<pubDate>Tue, 09 Mar 2010 14:33:32 +0000</pubDate>
		<guid isPermaLink="false">http://witte-consulting.com/blog/?p=141#comment-541</guid>
		<description>Exception in thread "main" java.lang.UnsatisfiedLinkError: sendechotohost
        at NativePing.sendechotohost(Native Method)
        at NativePing.getResultForTheHost(NativePing.java:517)
        at NativePing.pingHost(NativePing.java:396)
        at NativePing.pingHost(NativePing.java:422)
        at NativePing.pingHost(NativePing.java:384)
        at NativePing.main(NativePing.java:616)

In Linux I am getting this error. Can any one explain....</description>
		<content:encoded><![CDATA[<p>Exception in thread &#8220;main&#8221; java.lang.UnsatisfiedLinkError: sendechotohost<br />
        at NativePing.sendechotohost(Native Method)<br />
        at NativePing.getResultForTheHost(NativePing.java:517)<br />
        at NativePing.pingHost(NativePing.java:396)<br />
        at NativePing.pingHost(NativePing.java:422)<br />
        at NativePing.pingHost(NativePing.java:384)<br />
        at NativePing.main(NativePing.java:616)</p>
<p>In Linux I am getting this error. Can any one explain&#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: degree</title>
		<link>http://witte-consulting.com/blog/jni-java-native-interface-exception-in-thread-main-javalangunsatisfiedlinkerror-can-t-find-dependent-libraries/comment-page-1/#comment-539</link>
		<dc:creator>degree</dc:creator>
		<pubDate>Fri, 12 Feb 2010 09:17:20 +0000</pubDate>
		<guid isPermaLink="false">http://witte-consulting.com/blog/?p=141#comment-539</guid>
		<description>just need to build the helloworld.c following way

cl -I c:\Java\jdk1.6.0_01\include -I c:\Java\jdk1.6.0_01\include\win32 -LD HelloWorld.c -FeHelloWorld.dll

Not with -MD option.  Java load library functions are not able to load because of -MD option. I think JNI documentations should be updated.</description>
		<content:encoded><![CDATA[<p>just need to build the helloworld.c following way</p>
<p>cl -I c:\Java\jdk1.6.0_01\include -I c:\Java\jdk1.6.0_01\include\win32 -LD HelloWorld.c -FeHelloWorld.dll</p>
<p>Not with -MD option.  Java load library functions are not able to load because of -MD option. I think JNI documentations should be updated.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Manoj</title>
		<link>http://witte-consulting.com/blog/jni-java-native-interface-exception-in-thread-main-javalangunsatisfiedlinkerror-can-t-find-dependent-libraries/comment-page-1/#comment-535</link>
		<dc:creator>Manoj</dc:creator>
		<pubDate>Wed, 27 Jan 2010 09:12:22 +0000</pubDate>
		<guid isPermaLink="false">http://witte-consulting.com/blog/?p=141#comment-535</guid>
		<description>add option "-Wl,--kill-at" 

 `--kill-at'
        Specifies that when `dlltool' is creating the
        exports file it should not append the string
        `@ '.  These numbers are called
        ordinal numbers and they represent another
        way of accessing the function in a DLL, other
        than by name.


With this the problem will go away sure shot.</description>
		<content:encoded><![CDATA[<p>add option &#8220;-Wl,&#8211;kill-at&#8221; </p>
<p> `&#8211;kill-at&#8217;<br />
        Specifies that when `dlltool&#8217; is creating the<br />
        exports file it should not append the string<br />
        `@ &#8216;.  These numbers are called<br />
        ordinal numbers and they represent another<br />
        way of accessing the function in a DLL, other<br />
        than by name.</p>
<p>With this the problem will go away sure shot.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Amaresh</title>
		<link>http://witte-consulting.com/blog/jni-java-native-interface-exception-in-thread-main-javalangunsatisfiedlinkerror-can-t-find-dependent-libraries/comment-page-1/#comment-528</link>
		<dc:creator>Amaresh</dc:creator>
		<pubDate>Wed, 11 Nov 2009 10:19:06 +0000</pubDate>
		<guid isPermaLink="false">http://witte-consulting.com/blog/?p=141#comment-528</guid>
		<description>Wow !!
Thanks so much.

This topic helped me getting started with Java -&#62; JNI -&#62; DLL.

Thanks</description>
		<content:encoded><![CDATA[<p>Wow !!<br />
Thanks so much.</p>
<p>This topic helped me getting started with Java -&gt; JNI -&gt; DLL.</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nethibernate</title>
		<link>http://witte-consulting.com/blog/jni-java-native-interface-exception-in-thread-main-javalangunsatisfiedlinkerror-can-t-find-dependent-libraries/comment-page-1/#comment-504</link>
		<dc:creator>nethibernate</dc:creator>
		<pubDate>Sun, 09 Aug 2009 14:48:42 +0000</pubDate>
		<guid isPermaLink="false">http://witte-consulting.com/blog/?p=141#comment-504</guid>
		<description>Thanks Alexandra, your insight really works.
I got the same problem with Kai. I think it's not about the procedure name. If you remove the "-MD" option when you link the C file, it can work.</description>
		<content:encoded><![CDATA[<p>Thanks Alexandra, your insight really works.<br />
I got the same problem with Kai. I think it&#8217;s not about the procedure name. If you remove the &#8220;-MD&#8221; option when you link the C file, it can work.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kai Witte</title>
		<link>http://witte-consulting.com/blog/jni-java-native-interface-exception-in-thread-main-javalangunsatisfiedlinkerror-can-t-find-dependent-libraries/comment-page-1/#comment-502</link>
		<dc:creator>Kai Witte</dc:creator>
		<pubDate>Wed, 22 Jul 2009 19:30:03 +0000</pubDate>
		<guid isPermaLink="false">http://witte-consulting.com/blog/?p=141#comment-502</guid>
		<description>Hello,

is that all the error message you get? Delete the .dll, try again. When it is still the same message, then you know more about the problem. Otherwise you know more as well. Win-win.

Kai</description>
		<content:encoded><![CDATA[<p>Hello,</p>
<p>is that all the error message you get? Delete the .dll, try again. When it is still the same message, then you know more about the problem. Otherwise you know more as well. Win-win.</p>
<p>Kai</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Look Out</title>
		<link>http://witte-consulting.com/blog/jni-java-native-interface-exception-in-thread-main-javalangunsatisfiedlinkerror-can-t-find-dependent-libraries/comment-page-1/#comment-501</link>
		<dc:creator>Look Out</dc:creator>
		<pubDate>Mon, 20 Jul 2009 12:28:36 +0000</pubDate>
		<guid isPermaLink="false">http://witte-consulting.com/blog/?p=141#comment-501</guid>
		<description>I have a problem creating a simple Java Application that uses JNI to load a dll that prints the mesage "HelloWorld".

The following stages were succesful:
1. Creating the HelloWorld.java file and compiling it.
2. Using javah -jni to produce HelloWorld.h (a C/C++ header file)
3. Coding the HelloWorld.c file and compiling it to get:
    a) HelloWorld.exp, HelloWorld.dll, HelloWorld.lib, HelloWorld.obj

The stage where I am failing:
1. Running the Java program using: java HelloWorld at the command line produces the following error:
Exception in thread "main" java.lang.UnsatisfiedLinkError: HelloWorld.helloWorld
()V
        at HelloWorld.helloWorld(Native Method)
        at HelloWorld.main(HelloWorld.java:8)

C:\&#62;
For compilation purposes I am using the Microsoft Visual C++ 2008 Express Edition's command line utility

What could be the problem with my program

Thanks in anticipation of the best help you can offer</description>
		<content:encoded><![CDATA[<p>I have a problem creating a simple Java Application that uses JNI to load a dll that prints the mesage &#8220;HelloWorld&#8221;.</p>
<p>The following stages were succesful:<br />
1. Creating the HelloWorld.java file and compiling it.<br />
2. Using javah -jni to produce HelloWorld.h (a C/C++ header file)<br />
3. Coding the HelloWorld.c file and compiling it to get:<br />
    a) HelloWorld.exp, HelloWorld.dll, HelloWorld.lib, HelloWorld.obj</p>
<p>The stage where I am failing:<br />
1. Running the Java program using: java HelloWorld at the command line produces the following error:<br />
Exception in thread &#8220;main&#8221; java.lang.UnsatisfiedLinkError: HelloWorld.helloWorld<br />
()V<br />
        at HelloWorld.helloWorld(Native Method)<br />
        at HelloWorld.main(HelloWorld.java:8)</p>
<p>C:\&gt;<br />
For compilation purposes I am using the Microsoft Visual C++ 2008 Express Edition&#8217;s command line utility</p>
<p>What could be the problem with my program</p>
<p>Thanks in anticipation of the best help you can offer</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kai Witte</title>
		<link>http://witte-consulting.com/blog/jni-java-native-interface-exception-in-thread-main-javalangunsatisfiedlinkerror-can-t-find-dependent-libraries/comment-page-1/#comment-500</link>
		<dc:creator>Kai Witte</dc:creator>
		<pubDate>Tue, 07 Jul 2009 15:44:03 +0000</pubDate>
		<guid isPermaLink="false">http://witte-consulting.com/blog/?p=141#comment-500</guid>
		<description>Thanks Alexandra,

your insight will help many people! This post gets lots of hits every day :-)

Kai</description>
		<content:encoded><![CDATA[<p>Thanks Alexandra,</p>
<p>your insight will help many people! This post gets lots of hits every day :-)</p>
<p>Kai</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alexandra Niculai</title>
		<link>http://witte-consulting.com/blog/jni-java-native-interface-exception-in-thread-main-javalangunsatisfiedlinkerror-can-t-find-dependent-libraries/comment-page-1/#comment-499</link>
		<dc:creator>Alexandra Niculai</dc:creator>
		<pubDate>Tue, 07 Jul 2009 14:58:28 +0000</pubDate>
		<guid isPermaLink="false">http://witte-consulting.com/blog/?p=141#comment-499</guid>
		<description>So, I searched a lot, but I found a solution that worked for me. Removing the -MD gives you this:
cl -Ic:\java\include -Ic:\java\include\win32 -LD HelloWorld.c -FeHelloWorld.dll

For me, it worked! For the rest, I can't speak C++ and I don't know why it happened.</description>
		<content:encoded><![CDATA[<p>So, I searched a lot, but I found a solution that worked for me. Removing the -MD gives you this:<br />
cl -Ic:\java\include -Ic:\java\include\win32 -LD HelloWorld.c -FeHelloWorld.dll</p>
<p>For me, it worked! For the rest, I can&#8217;t speak C++ and I don&#8217;t know why it happened.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
