title: Execute Java program server-side from a Node.js / Heroku app?
body: <p>Can I call a Java program from a Node.js application on Heroku?</p>
  
  <p>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.</p>
  
  <p>So, could write a command line program, that takes an input file and pipes the results to stdout, e.g. </p>
  
  <p><code>java mytask.class -cp ./mylibrary.jar --in /tmp/file.in &gt; output.json</code></p>
  
  <p>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.</p>