[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Some observations
On Monday, December 18, 2000, at 12:13 AM, Sean Allen wrote:
> The Java Product Versionin Specification (November 30 1998 )
> Says
> An implementation of the Java Virtual Machine should be identify both the
> specification and the implementation. These properties should be added to
> those already available using java.lang.System.getProperties.
> java.vm.specification.version
> i.e. 1.3
> java.vm.specification.vendor
> i.e. Sun Microsystems Inc.
> java.vm.specification.name
> i.e. JavaTM Virtual Machine Specification
> java.vm.version
> i.e. Solaris 5.5 Native 1.0 build32
> java.vm.vendor
> i.e. Sun Microsystems Inc.
> java.vm.name
> i.e. Solaris 5.x JVM
Here's my test app:
import java.io.*;
class version {
protected static void printProperty(String prop) {
System.out.println(prop + " = " + System.getProperty(prop));
}
public static void main(String[] args) throws IOException,InterruptedException {
String javaversion[]={"/usr/bin/java","-version"};
printProperty("java.vm.specification.version");
printProperty("java.vm.specification.vendor");
printProperty("java.vm.specification.name");
printProperty("java.vm.version");
printProperty("java.vm.vendor");
printProperty("java.vm.name");
System.out.println("Calling java -version:");
Process javaproc=Runtime.getRuntime().exec(javaversion);
javaproc.waitFor();
InputStream data=javaproc.getErrorStream();
for(;data.available()>0;System.out.print((char)data.read()));
}
}
And here's my output:
java.vm.specification.version = 1.0
java.vm.specification.vendor = Sun Microsystems Inc.
java.vm.specification.name = Java Virtual Machine Specification
java.vm.version = 1.3.0
java.vm.vendor = Apple Computer, Inc.
java.vm.name = Java HotSpot(TM) Client VM
Calling java -version:
java version "1.2.2"
Java HotSpot(TM) Client VM (1.3.0, mixed mode, internal release build)
No property told the right version. Is this a bug?
andy
--
Description forthcoming.