Add JRegistryKey.jar to the library.
Then copy and paste JRegistryKey.dll into my project.
After that I run the same program, the registry key has been successfully created.
RegistryKey r=new RegistryKey(RootKey.HKEY_CURRENT_USER,"Software\\Microsoft\\Windows\\CurrentVersion\\Run"); RegistryValue v=new RegistryValue("name or the registrykey",ValueType.REG_SZ,"my jar file path"); r.setValue(v);
source share