< prev index next >

## src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/NashornScriptEngine.java

Print this page

    @@ -65,12 +65,16 @@
      * JSR-223 compliant script engine for Nashorn. Instances are not created directly, but rather returned through
      * {@link NashornScriptEngineFactory#getScriptEngine()}. Note that this engine implements the {@link Compilable} and
      * {@link Invocable} interfaces, allowing for efficient precompilation and repeated execution of scripts.
      * @see NashornScriptEngineFactory
      *
    + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool
    + * are deprecated with the intent to remove them in a future release.
    + *
      * @since 1.8u40
      */
    +@Deprecated(since="11", forRemoval=true)
     public final class NashornScriptEngine extends AbstractScriptEngine implements Compilable, Invocable {
         /**
          * Key used to associate Nashorn global object mirror with arbitrary Bindings instance.
          */
         public static final String NASHORN_GLOBAL = "nashorn.global";

    @@ -133,10 +137,14 @@
                         throw e;
                     }
                 }
             }, CREATE_CONTEXT_ACC_CTXT);

    +        if (!nashornContext.getEnv()._no_deprecation_warning) {
    +            System.err.println("Warning: Nashorn engine is planned to be removed from a future JDK release");
    +        }
    +
             // cache this option that is used often
             this._global_per_engine = nashornContext.getEnv()._global_per_engine;

             // create new global object
             this.global = createNashornGlobal();

< prev index next >