Fix for JDK-8046014 removes the null-check for the script class in Context.getProgramFunction(), causing a NullPointerException down the line for scripts that fail to compile: Exception in thread "main" java.lang.NullPointerException at java.lang.invoke.MethodHandles$Lookup.checkSymbolicClass(MethodHandles.java:1390) at java.lang.invoke.MethodHandles$Lookup.resolveOrFail(MethodHandles.java:1373) at java.lang.invoke.MethodHandles$Lookup.findStatic(MethodHandles.java:774) at jdk.nashorn.internal.runtime.Context.getCreateProgramFunctionHandle(Context.java:1025) at jdk.nashorn.internal.runtime.Context.getProgramFunction(Context.java:1020) at jdk.nashorn.internal.runtime.Context.compileScript(Context.java:1042) at jdk.nashorn.internal.runtime.Context.compileScript(Context.java:520) at jdk.nashorn.tools.Shell.runScripts(Shell.java:314) at jdk.nashorn.tools.Shell.run(Shell.java:169) at jdk.nashorn.tools.Shell.main(Shell.java:133) at jdk.nashorn.tools.Shell.main(Shell.java:112)