salut
j'ai compilé ce code
/********************code******************************/
package registre_access;
import com.ms.dll.*;
public class TestChangeDirectory {
public static void main (String[] args) {
try {
System.loadLibrary ("KERNEL32");
} catch ( Exception e ) {
e.printStackTrace();
System.exit ( 1 );
}
boolean rc;
// for demonstration
// we specify a non-existent directory, to get an error code...
StringBuffer newdir = new StringBuffer("Unknown directory");
rc = SetCurrentDirectoryA(newdir);
if (!rc) {
int err = DllLib.getLastWin32Error();
// should be rc : 2 "ERROR_FILE_NOT_FOUND"
System.out.println("rc : " + err);
// you may want to throw an exception here...
}
else {
System.out.println("Done.");
}
// keep the console open...
try {System.in.read();}catch(Exception e){}
}
static native boolean SetCurrentDirectoryA(StringBuffer newdir);
}
/**************************************************/
en executant le code j'ai eu le message suivant
je n'est pas compris de quoi s'agit il et comment y remedier
/////////******message*********************************////
java.lang.UnsatisfiedLinkError: SetCurrentDirectoryA
at registre_access.TestChangeDirectory.SetCurrentDirectoryA(Native Method)
at registre_access.TestChangeDirectory.main(TestChangeDirectory.java:18)
Exception in thread "main"
merci de m'aider
Partager