Changing 'console.log' to 'print' so the js code works in nashorn