Start of Tutorial > Start of Trail > Start of Lesson | Search |
Downward binary compatibility is generally supported, though not guaranteed. That is, class files built with a 1.1.x compiler, but relying only on APIs defined in 1.0.x, will generally run on 1.0.x versions of the Java Virtual Machine, but this "downwards" compatibility has not been extensively tested and cannot be guaranteed. Of course, if the class files depend on any new 1.1.x APIs, those files will not work on 1.0.x systems.
In general, the JavaSoft policy is that:
Downward source compatibility is not supported. If source files use new language features or APIs in JDK 1.1.x, they will not be usable with an earlier version of Java.
In general, the JavaSoft policy is that:
In JDK 1.1 we have introduced the concept of deprecated API. These are methods and classes that are supported only for backwards compatibility, and the compiler will generate a warning message whenever one of these is used. It is recommended that programs be modified to eliminate the use of deprecated methods and classes, but it has not been determined whether the deprecated elements will ever be removed entirely from the system.
The following is intended to be a complete list of all cases where a program that works under 1.0.x would fail to work under 1.1.x. If you know of other broad areas of incompatibility, please notify us (at address at the bottom of the page).
java.io.Printstream
print(double)
println(double)
java.lang.Double
toString
java.lang.String
valueOf(double)
The following methods have been changed to conform to the
Java Language Specification, section
20.9.16. Previously these methods returned
machine-specific results.
java.io.Printstream
print(float)
println(float)
java.lang.Float
toString
java.lang.String
valueOf(float)
System.in
, System.out
, and
System.err
are now final
. Applets
cannot change their values. The following methods have been
added to class System so that applications, but not applets,
can reassign standard in, standard out, and standard
err. public static void setIn(InputStream in)
public static void setOut(PrintStream out)
public static void setErr(PrintStream err)
checkPropertyAccess(String prop,
String defval)
in
java.lang.SecurityManager
has been removed in
this release. It is a useless method that was inadvertently
included in JDK 1.0.2; it should never have been included.
java.lang.ClassFormatError: Arguments
can't fit into locals
.
Unfortunately, this meaning of super invocation does not account for binary-compatible changes to classes, such as inserting new classes into the type hierarchy, or overriding the specified method in a class between the source class and target class of the super invocation. (This bug is described in The Java Language Specification, section 13.4.5.)
Some Java APIs in JDK 1.1 contain exactly such binary-compatible changes. As a result, 1.0.x code compiled with the incorrect super semantics can behave unpredictably on 1.1 Java Virtual Machines, if they use these APIs via super invocation. This is because the new overriding methods may be necessary for correct operation of the updated class (for example, taking a lock before invoking the next method).
The 1.1 (non-optimizing) Java compiler uses the correct semantics for super invocations. It records the fact that it uses the correct semantics by setting a flag in a generated class file; older compilers do not set this flag. A 1.0.2 or later Java Virtual Machines uses the correct super semantics for code in a class file when it finds this flag set. In all other cases, an old or new Virtual Machine will use the old, incorrect semantics for super invocation. (The possibility that some intermediate super methods were inlined means that a Java Virtual Machine cannot attempt to "correct" the semantics of super invocation in unflagged binaries at run time.)
Start of Tutorial > Start of Trail > Start of Lesson | Search |