The Java
Runtime for Symbian version is part of the return string from
the system property microedition.platform
. To retrieve the version value, you need to separate the java_build_version
value from the rest of the return string.
The JRT version value is a three-digit version number (x.y.z
), in which the first two numbers indicate the major
and minor versions, while the third number indicates the internal
revision, or build. For example, a device with Java Runtime 1.3 for
S60 can return the string 1.3.4
.
The following example method determines the JRT version and returns
its value as a String
object:
public String getJavaVersion() { String platformString = System.getProperty("microedition.platform"); String version = ""; int index = 0; index = platformString.toLowerCase().indexOf("java_build_version"); if (index != 0) { version = platformString.substring(index + 19); } else { version = "N/A"; } return version; }
For a full example MIDlet, see How to retrieve version number of Java Runtime for S60 on Forum Nokia.
For more information about the version scheme, see Naming and versioning of Java Runtime for Symbian on Forum Nokia.