The current setup is made on OS X Yosemite and the latest Eclipse (Luna). But the setup for other OSs should run almost the same way.
1. Verify you have JDK8 installed.
2. Using mercurial clone the repository http://hg.openjdk.java.net/jdk9/dev to the folder you want and execute get_sources.sh
3. Now switch to Eclipse and create a project called Nashorn directly in the folder “<JDK9_SOURCES>/nashorn”
4. Eclipse is quite clever to find source folders:
5. A bit tricky part: The compilation, development and debugging currently is done against JDK8 since the IDE still does not support JDK9 and the jimage distribution mechanism. So, in order JDK’s Nashorn not to interfere with one we build it’s a good idea to make a new copy of JDK8 and to remove the nashorn.jar from the JDK located under <JDK8_ROOT>/jre/lib/ext/nashorn.jar:
6. Now add this JDK to the IDE:
8. Before running the Nashorn itself the nasgen “all” ant target should be run.
9. Add the resulting “nasgen.jar” to the “Build Path” if it’s not there already.
10. Navigate to “<nashorn>/make” folder and run the “all” ant target.
11. Add the resulting classed in “<nashorn>/build/classes/” to the “Build Path”:
12. Now it is possible to run the Shell.java to explore and debug the code:
Debugging is available directly in the IDE :
Have fun developing the Nashorn!