I am trying to create a web application(in java) that can communicate with a ros server. Therefore I use the rosnode module. For the website I use vaadin. My problem is that I do not know how to call/execute the rosnode javascript based files.
When I try to call the rosnode.initNode I get the following error:
javax.script.ScriptException: SyntaxError: /home/philipp/webappvaadinros/my-starter-project/src/main/java/ros/webapp/com/nodejs/rosserver.js:3:0 Expected an operand but found let
let rosnodejs = require('/home/philipp/webappvaadinros/my-starter-project/node_modules/rosnodejs/dist/index.js');
^ in <eval> at line number 1
As scriptengine I use NashornScriptEngine. I should mention that I am new to javascript. Can anyone help me?