Access restriction: The type 'NashornScriptEngine' is not API (restriction on required library 'C:\...\Java\jdk1.8.0_05\jre\lib\ext\nashorn.jar')





In this tutorial we will solve compilation error  Access restriction: The type 'NashornScriptEngine' is not API (restriction on required library 'C:\Program Files\Java\jdk1.8.0_05\jre\lib\ext\nashorn.jar')
SOLUTION TO > We Access restriction: The type 'NashornScriptEngine' is not API (restriction on required library 'C:\Program Files\Java\jdk1.8.0_05\jre\lib
\ext\nashorn.jar') >


Step 1.1:
click Windows, Preferences,


Step 1.2:
type error,
Go to Errors/warnings  (which is under Java > Compiler > Errors/warnings)

Step 1.3:
type deprecated,
In Deprecated and restricted API -
  1. In Forbidden reference (access rules ) -  Earlier Errors is selected. Now, select ignore.
And now compilation error Access restriction: The type 'NashornScriptEngine' is not API (restriction on required library 'C:\Program Files\Java\jdk1.8.0_05\jre\lib\ext\nashorn.jar') is solved.


RELATED LINKS>

Autoboxing and unboxing in java - How it works internally in detail with 10 examples- Widening, AutoBoxing and Var-args

Java caches Integer objects formed from primitive int values between values -128 to 127

10 points on why we are still using primitive data types in java ? When to use primitive type and wrapper classes?

Method overloading with Widening, Autoboxing and Var-args - Who beats whom in java?


eEdit
Must read for you :