1. Install Node.js using the conventional ‘.configure’, ‘make’, ‘make install’ trio. Put it in common location or add the installed dir to $PATH.
2. In sublime text, create a new build system:
‘Tools > Build System > New Build System…’. This creates a new file with build template.
3. Modify the file as below:
"cmd": ["node", "$file"]
4. Save it as
in it. Build and run the file using Ctrl+B or menu item as you like.
PS: For Java, refer a similar post.