But we have Java Function node in Node-red. Is this java function node helpful.
I have downloaded from manage pallete using " npm install node-red-contrib-java-function " in nodered
If you follow the link to the node's GitHub repository you will find that it no longer exists, so the node is no longer supported. It has not been updated for three years, so even if it does currently work it is very likely that it will stop working at some point.
I suggest you find a different way of solving your problem. Why do you want to use Java?