Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Exception in thread "main" java.lang.UnsatisfiedLinkError: Method Name

Reply
Thread Tools

Exception in thread "main" java.lang.UnsatisfiedLinkError: Method Name

 
 
newage newage is offline
Junior Member
Join Date: Dec 2010
Posts: 1
 
      12-05-2010
Hello.
Please help me !!!
--------------------------------------------------------------------------
I have a DLL and it used two ways in Java :

DLL : HelloWorldImpl.dll
OS : Windows 2003
java version : 1.5.0_08
javac version : 1.5.0_08

Method 1: folder TEST1
Two file names are Main.java HelloWorld.java and that includes the following code:

HelloWorld.java
Code:
public class HelloWorld
{
  public native void displayHelloWorld();
  static
  {
    System.loadLibrary("HelloWorldImpl");
  }
}
Main.java
Code:
public class Main 
{
  public static void main(String[] args)
  {
    HelloWorld hw = new HelloWorld();
    hw.displayHelloWorld();
  }
}
When the command I run java Main output below shows the correct implementation of the program suggests.
Code:
Hello world!
Method 2: folder TEST2
HelloWorld.java the folder name is MyDll which includes the following code:

HelloWorld.java
Code:
package MyDll;
public class HelloWorld
{
  public native void displayHelloWorld();
  static
  {
    System.loadLibrary("HelloWorldImpl");
  }
}
TEST2 folder includes:
MyDll folder and file Main.java

Main.java
Code:
import MyDll.*;
public class Main 
{
  public static void main(String[] args)
  {
    HelloWorld hw = new HelloWorld();
    hw.displayHelloWorld();
  }
}
When the command I run java Main shows the following error.
Code:
Exception in thread "main" java.lang.UnsatisfiedLinkError: displayHelloWorld
        at MyDll.HelloWorld.displayHelloWorld (Native Method)
        at Main.main (Main.java: 7)
 

Last edited by newage; 12-05-2010 at 06:14 AM..
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Exception in thread "main" java.lang.UnsatisfiedLinkError: <method name> debapriya.patra Java 0 03-18-2009 09:43 AM
Exception of type 'System.Web.HttpUnhandledException' wasthrown.Exception has been thrown by the target of an invocation.System.WebSystem.Exception jobs ASP .Net 1 11-16-2007 05:57 PM
while executing my client program i get the exception javax.naming.LinkException: [Root exception is javax.naming.LinkException: [Root exception is javax.naming.NameNotFoundException: remaining if plz anybody know how to solve this problem then mahesh Java 0 03-08-2007 12:26 PM
method for Exception base class to raise the exception in an expression? Bengt Richter Python 0 07-07-2005 05:07 PM
Re: Urgent! how to get object name, method name and attribute name based on the strings? ding feng C++ 2 06-25-2003 01:18 PM



Advertisments