Can I call a Java program from a Node.js application on Heroku?
I have a Node.js/Heroku app. But now need to add server-side capability to run an algorithm on an input data file and output data to a JSON format. I already have a Java library that can read the file and run the algorithm, and it would be very difficult (at best) for me to re-write it in pure Node.js.
So, could write a command line program, that takes an input file and pipes the results to stdout, e.g.
java mytask.class -cp ./mylibrary.jar --in /tmp/file.in > output.json
Is it possible to shell out a call to a Java command line program from Node.js? I know one can deploy Java applications to Heroku, but here want to execute a bit of Java from a Node.js app.