java.lang.UnsatisfiedLinkError:

Hi

I have wriiten a program for writing and reading from the registry

My code use a DLL file and a jar file.I am using eclipse as my ide

when i run my program from eclipse its working properly

but when i make a jar of my code and excecute its givein me

java.lang.UnsatisfiedLinkError:

My code is given below

import ca.beq.util.win32.registry.RegistryKey;

import ca.beq.util.win32.registry.RegistryValue;

import ca.beq.util.win32.registry.RootKey;

import ca.beq.util.win32.registry.ValueType;

public class CheckRegistry {

public static String Version = "MG 3.4.13.1";

public static String DBVersion = "DB 3.4.1.1";

public static String BuildDate = "05/14/2007";

public static void writeToRegistry(String component1) {

String pathV = "Software\\ABC Inc\\Enterprise \\"

+ component1;

RegistryKey r = new RegistryKey

(RootKey.HKEY_LOCAL_MACHINE, pathV);

if (!r.exists()) {

r.create();

RegistryValue version = new RegistryValue("Version",

ValueType.REG_SZ, Version);

RegistryValue path = new RegistryValue("InstallPath",

ValueType.REG_SZ, System.getProperty("user.dir"));

RegistryValue dbversion = new RegistryValue

("DBSchemaVersion",

ValueType.REG_SZ, DBVersion);

r.setValue(version);

r.setValue(path);

r.setValue(dbversion);

System.out.println("Wrote Succesfully to Registry");

} else {

// Need to update the software

}

}

public void readFromRegistry(String component) {

String pathV = "Software\\ABC \\Enterprise\\"

+ component;RegistryKey r = new RegistryKey

(RootKey.HKEY_LOCAL_MACHINE, pathV);

System.out.println("Path = " + pathV);

if (r.exists()) {

if (r.hasValue("Version")) {

RegistryValue v = r.getValue("Version");

System.out.println(v.toString());

}

if (r.hasValue("InstallPath")) {

RegistryValue v = r.getValue("InstallPath");

System.out.println(v.toString());

}

if (r.hasValue("DBSchemaVersion")) {

RegistryValue v = r.getValue("DBSchemaVersion");System.out.println(v.toString());

}

} else {

System.out.println("Error--");

}

}

static {

System.loadLibrary("jRegistryKey");

System.out.println("Sucessfully Loaded The DLL ");

}

public static void main(String args[]) {

new CheckRegistry().readFromRegistry("Manager");

}

}

the error i m gettin is

Exception in thread "main" java.lang.UnsatisfiedLinkError: no

jRegistryKey in java.library.path

at java.lang.ClassLoader.loadLibrary(Unknown Source)

at java.lang.Runtime.loadLibrary0(Unknown Source)

at java.lang.System.loadLibrary(Unknown Source)

at CheckRegistry.<clinit>(CheckRegistry.java:61)

How to solve this please help me

[2949 byte] By [Prakash_Halana] at [2007-11-27 4:57:01]
# 1
It seems the DLL is not in your class path. Include it in your classpath.
AnanSmritia at 2007-7-12 10:12:21 > top of Java-index,Java Essentials,Java Programming...
# 2

I have set the class path .still not working .

My dll file is inside the jar file. its not able to load the file from

inside the jar file if i keep it outside then its working but i want

every thing in one jar . For loading the dll file from inside

i used CheckRegistry.class.getResource("..").getPath();

but still its not working

Prakash_Halana at 2007-7-12 10:12:21 > top of Java-index,Java Essentials,Java Programming...
# 3
Include your jar file in the classpath.
AnanSmritia at 2007-7-12 10:12:21 > top of Java-index,Java Essentials,Java Programming...
# 4
-Ensure that DLL and all relevant JARS you are using should be defined in you classpathIf does not help then try to-Ensure your enviornment variable 'PATH' includes path to your DLL fileHope it will work!
pundeera at 2007-7-12 10:12:21 > top of Java-index,Java Essentials,Java Programming...