473,414 Members | 1,775 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

java.lang.UnsatisfiedLinkError

Hi,

I have written a jni program to call my vc++ dll.
My java program is as below:
//CODE
import java.util.*;

class callVcc
{
native int sum(int i, int j);
static
{

System.loadLibrary("getSum");
}

public static void main(String args[])
{
callVcc sumnum = new callVcc();
int z;
z = sumnum.sum(1,2);
System.out.println("Result::::" + z);
}


}

My vc++ dll is as follows::

// getSum.cpp : Defines the entry point for the DLL application.
//

#include "stdafx.h"
#include <jni.h>
#include "callVcc.h"

#ifdef _MANAGED
#pragma managed(push, off)
#endif

BOOL APIENTRY DllMain( HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
return TRUE;
}

JNIEXPORT jint JNICALL Java_callVcc_sum
(JNIEnv * env, jobject jobj, jint x, jint y)
{
return x+y;
}

getSum.def file is as follows::

#ifdef _MANAGED
#pragma managed(pop)
#endif

LIBRARY GETSUM

EXPORTS
sum @1


//CODE

While compiling I am not getting any error ,but while trying to run the java program ,I am getting java.lang.UnsatisfiedLinkError :sum at callVcc.sum<Native method>
at callVcc.main<callVcc.java:15>

Any help would be highly appreciated


Gayatri
Aug 8 '07 #1
1 9732
JosAH
11,448 Expert 8TB
While compiling I am not getting any error ,but while trying to run the java program ,I am getting java.lang.UnsatisfiedLinkError :sum at callVcc.sum<Native method>
at callVcc.main<callVcc.java:15>

Any help would be highly appreciated


Gayatri
Have you tried to explicitly set the "library.path" system property? Obviously
your library can't be found now. Add a -Dlibrary.path=/path/to/you/lib.dll to
java's command line

kind regards,

Jos
Aug 8 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Phillip Montgomery | last post by:
Hello all; I'm trying to debug an issue with a java script called, SelectSockets. It appears to be a fairly common one found on the web. I downloaded the SGI Java v1.4.1 installation from SGI's...
0
by: mailkhurana | last post by:
Hii , I am trying to use a type 2 driver to connect to DB2 0n AIX 5 I have a small java test to class to establish a conneciton with the db .. I am NOT using WAS or any appserver When I try to...
6
by: Rhino | last post by:
I'm trying to debug a simple Java UDF written in the DB2General style within Eclipse. I'm getting a java.lang.UnsatisfiedLinkError when I execute the set() method in the UDF. I know that the...
4
by: the.new.delboy | last post by:
Hi, I'm working on an application which requires some native calls to be made from Java. The calls work fine in one version of my code. I need to change the location of my native calls to a...
1
by: Akaketwa | last post by:
i have an application deployed on WAS6.0 that uses a db2 v8.1 database on a linux platform. when i try to run it i get a java.lang.UnsatisfiedLinkError:SQLConnect error. i have tried some solution...
3
by: Jazi | last post by:
Hi, I have built a web servise using JNI under jboss. The JNI loads a native library static { Ststem.loadLibrary("foo"); } If I starts the jboss server then I do not have any issue...
0
by: ycinar | last post by:
hey all, i am working on a Java project using JBuilder.. when i build my code its fine, but when comes to run, it doesnt run and displays the following logs.. i think there is JDK conflict.. ...
2
by: Arati | last post by:
Hi I am new to this jni. I have written a jni program to print HelloWorld,when i run the java code. I made one HelloWorld.dll using HelloWorld.c and HelloWorld.h using this link...
1
Ganesh9u
by: Ganesh9u | last post by:
Hi All, import org.sf.feeling.swt.win32.extension.hook.Hook; import org.sf.feeling.swt.win32.extension.hook.data.HookData; import org.sf.feeling.swt.win32.extension.hook.data.MouseHookData; ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.