当前位置: 技术问答>java相关
关于Provider的一个莫明其炒的错误
来源: 互联网 发布时间:2014-12-22
本文导语: import java.security.*; public class provider { public static void main(String[] args) { Provider p = Security.getProvider("Sun"); System.out.println("MyPro provider name is " + p.getName()); // System.out.println("MyPro provi...
import java.security.*;
public class provider
{ public static void main(String[] args)
{
Provider p = Security.getProvider("Sun");
System.out.println("MyPro provider name is " + p.getName());
// System.out.println("MyPro provider version # is " + p.getVersion());
// System.out.println("MyPro provider info is " + p.getInfo());
}
}
为何p的值会是NULL,
我的环境:
echo %Classpath%值为:.;C:WINNTjavaclasses;C:JDKjavasoftjre1.2librt.jar
在目录:C:JDKjavasoftjre1.2libSecurity有java.security文件,
没有更改过
public class provider
{ public static void main(String[] args)
{
Provider p = Security.getProvider("Sun");
System.out.println("MyPro provider name is " + p.getName());
// System.out.println("MyPro provider version # is " + p.getVersion());
// System.out.println("MyPro provider info is " + p.getInfo());
}
}
为何p的值会是NULL,
我的环境:
echo %Classpath%值为:.;C:WINNTjavaclasses;C:JDKjavasoftjre1.2librt.jar
在目录:C:JDKjavasoftjre1.2libSecurity有java.security文件,
没有更改过
|
请试一下:
import java.security.*;
public class provider
{ public static void main(String[] args)
{
Provider p = Security.getProvider("SUN");
System.out.println("MyPro provider name is " + p.getName());
// System.out.println("MyPro provider version # is " + p.getVersion());
// System.out.println("MyPro provider info is " + p.getInfo());
}
}
import java.security.*;
public class provider
{ public static void main(String[] args)
{
Provider p = Security.getProvider("SUN");
System.out.println("MyPro provider name is " + p.getName());
// System.out.println("MyPro provider version # is " + p.getVersion());
// System.out.println("MyPro provider info is " + p.getInfo());
}
}