I'm developing an Eclipse Plug-in where I use Nashorn. When I run the same application as a standalone Java application, I face no errors. But when I run it as a plugin, I get this error -
java.lang.NoClassDefFoundError: jdk/nashorn/internal/runtime/options/Options
The stack trace further points to a location where I'm creating an Options object. I've already tried adding access restriction rules(just in case), but it doesn't help. I've also seen these two related links - How to make jdk.nashorn.api.scripting.JSObject visible in plugin , Access restriction: The type 'Application' is not API (restriction on required library rt.jar) , but the problem persists. I have double checked to ensure that the project is using Java 8.
Help?
I have got it working, but this seems more like a hack than an actual solution. I've copied nashorn.jar
from jdk1.8.0_66\jre\lib\ext
and included it in my build path.