System.setProperty ("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.ssl.protocol"); generates the following error: "Method setProperty(java.lang.String, java.lang.String) not found in class java.lang.System" How could this error ever be generated, since of course there is such a method in java.lang.System.
You didn't give a valid key in the first position. These are the valid keys.
Key = Description of Associated Value java.version = Java Runtime Environment version java.vendor = Java Runtime Environment vendor java.vendor.url = Java vendor URL java.home = Java installation directory java.vm.specification.version= Java Virtual Machine specification version java.vm.specification.vendor =Java Virtual Machine specification vendor java.vm.specification.name =Java Virtual Machine specification name java.vm.version =Java Virtual Machine implementation version java.vm.vendor =Java Virtual Machine implementation vendor java.vm.name =Java Virtual Machine implementation name java.specification.version =Java Runtime Environment specification version java.specification.vendor =Java Runtime Environment specification vendor java.specification.name =Java Runtime Environment specification name java.class.version =Java class format version number java.class.path =Java class path java.ext.dirs =Path of extension directory or directories os.name =Operating system name os.arch =Operating system architecture os.version =Operating system version file.separator =File separator ("/" on UNIX) path.separator =Path separator (":" on UNIX) line.separator =Line separator ("\n" on UNIX) user.name =User's account name user.home =User's home directory user.dir =User's current working directory
[This message has been edited by Cindy Glass (edited July 24, 2001).]
"JavaRanch, where the deer and the Certified play" - David O'Meara
Joined: May 07, 2001
Cindy, maybe this is a new property. The JSSE Extension installation indicates that in order to use the https protocol, you must set the "java.protocol.handler.pkgs" system property, either at the command line (which is not possible in the implementation I'm having to use) or via a call to System.setProperty(). I'm also getting a "security properties not found. using defaults" message when I compile. My java.security file is located in a standard location (<java-home>\lib\security) [This message has been edited by Scott Appleton (edited July 24, 2001).]
Well, if that works then Scott must have either misspelled the setProperty method name, or perhaps he has a stray version of a class called System that does not have this method or . . .
At any rate I was poking around looking at stuff related to this and I found an article that shows how to use URLStreamHandlerFactory as an alternative.
An alternative to using the XYZ.protocol.Handler package and class naming convention (along with the java.protocol.handler.pkgs system property) previously described is implementing your own URLStreamHandlerFactory. The default URLStreamHandlerFactory pays attention to the java.protocol.handler.pkgs system property and applies the package and class naming conventions. Your alternative implementation of the URLStreamHandlerFactory interface could get a handler implementation from wherever it wanted.
Thanks, Cindy. I'm going to explore this link and see what can be done. I have a partial answer to the original problem -- the IDE I'm using (which I HAVE to use, ugh) implements JDK 1.1.8. Turns out that setProperty(String, String) is new to the System class in 1.2, so the compiler used by the IDE doesn't recognize it. That doesn't explain the "security properties not found. using defaults" message when I compile using my own version of the JDK (v1.3).
subject: System.setProperty method not recognized?