Class AppletApiRemovalExamples

java.lang.Object
net.jrodolfo.java_evolution.java26.applet_api_removal.AppletApiRemovalExamples

public class AppletApiRemovalExamples extends Object
Demonstrates removal of the Applet API in Java 26.

This example does not try to run an applet or restore browser-plugin-era tooling. Instead, it writes a tiny legacy source file that imports java.applet.Applet, compiles it with the current JDK, and captures the compiler failure. That makes the removal visible without depending on old browser integrations or obsolete platform modules.

  • Constructor Details

    • AppletApiRemovalExamples

      public AppletApiRemovalExamples()
  • Method Details

    • compileLegacyApplet

      public AppletApiRemovalExamples.CompilationResult compileLegacyApplet(Path workspace) throws IOException, InterruptedException
      Compiles a tiny obsolete applet source file with the active JDK.
      Parameters:
      workspace - temporary directory for generated source files
      Returns:
      compilation result containing exit code and compiler output
      Throws:
      IOException - when the source file cannot be written or javac cannot be started
      InterruptedException - when waiting for the child compiler is interrupted
    • legacyAppletSource

      public String legacyAppletSource()
      Source that would compile only on JDKs where java.applet.Applet still existed.
      Returns:
      tiny obsolete applet source
    • historicalContext

      public String historicalContext()
      Explains what applets represented historically.
      Returns:
      a short historical note
    • java26Change

      public String java26Change()
      Describes the Java 26 change.
      Returns:
      a short removal note
    • migrationLesson

      public String migrationLesson()
      Explains the learning value.
      Returns:
      a short migration note