On windows NT plateform,
I try to use com.ms.lang.RegKey class to read environment variable from
window NT registry, if I use miscrosoft VM it is OK, I can read registry key
and value, But if I use sun VM I got following errors:
Exception in thread "main" java.lang.UnsatisfiedLinkError: pRegOpenBaseKey
at com.ms.lang.RegKey.pRegOpenBaseKey(Native Method)
at com.ms.lang.RegKey.<init>(RegKey.java)
at com.ms.lang.RegKey.<clinit>(RegKey.java)
at Test2.main(Test2.java)
Can some one please help me to solve this problem?, or can tell me another
way to read environment variable on windows NT plateform.
Thanks
The testing code Test2.java as following
============================================================
import java.util.*;
import com.ms.lang.*;
public class Test2
{
public static void main(String[] args)
{
RegKey rk = null;
try
{
rk = new RegKey(RegKey.USER_ROOT,"Environment",
RegKey.KEYOPEN_READ);
}catch(RegKeyException ex)
{
ex.printStackTrace();
System.out.println("Can not find register key!" );
System.exit(1);
}
String workPath = null;
try
{
workPath = rk.getStringValue("WORK_PATH");
}catch(RegKeyException ex)
{
ex.printStackTrace();
System.out.println("Can not find work path!" );
System.exit(1);
}
System.out.println("The work path is: " + workPath);
}