I'm using nashorn engine in embedding mode and providing user a command line textbox to interactive with nashorn. It's fund that nashorn engine's built-in functions or objects such as quit, Java were overwritten by user's mistaken typing:
quit=3; Java="Hello"; Is there a way to prevent user overwrite the built-in functions, objects and java objects exposed to nashorn engine?