Oracle has revealed its interim plan to help Java devs deal with browser-makers' imminent banishment of plug-ins.
Years of bugs in Java, Flash and other plugins have led browser-makers to give up on plugins. Apple recently decided that its Safari browser will just pretend Java, Flash and Silverlight aren't installed. Google has announced it will soon just not run any Flash content in its Chrome browser.
Oracle saw this movement coming and in January 2016 announced it would “deprecate the Java browser plugin in JDK 9”.
Big Red's now explained how this will happen in a brief notice on the OpenJDK mailing list that offers the following remedy:
Add the @Deprecated(since="9") annotation to the following classes:
Oracle explains its decision to work this way as follows:
We do not intend to remove the Applet API in the next major release, hence we will not specify
forRemoval = truein these annotations. If at some later point we do propose to remove this API then we will add
forRemoval = trueto these annotations at least one major release in advance.
Oracle adds that “These annotations will cause deprecation warnings to be emitted by the Java compiler for all code that uses this API. If warnings are treated as errors, they will result in the build failure.”
Big Red appears to be doing exactly what it said it would, as back in January it pledged “to deprecate the Java browser plugin in JDK 9.” That's been done. It also promised “This technology will be removed from the Oracle JDK and JRE in a future Java SE release.” Today's notice acts on that promise, but perhaps leaves the door open for the Applet API to survive beyond JDK 10 with the “one more major release” remark highlighted above. ®