I'm trying to execute a Jar file from a Javascript file to get the console output. I've pushed both files to Heroku, but when I try calling the function in the js file, I get this error:
/bin/sh: 1: java: not found exec error: Error: Command failed: java -jar -Xms1024m MongoConnector-all abaabaa
[31merror[39m: RangeError: Maximum call stack size exceeded
This is the code that I have:
const runCoreSearch = function(searchInputString) {
const exec = require('child_process').exec;
//child = exec('/usr/bin/java -jar ~/Applications/Mongo Connector-all.jar' + rakeInputString,
const child = exec('java -jar -Xms1024m MongoConnector-all ' + searchInputString,
function (error, stdout, stderr){
...
On their website (https://devcenter.heroku.com/articles/deploying-executable-jar-files) it says to use the command "heroku deploy:", but I'm not trying to deploy a Java project, just execute the jar from a node.js project. Any ideas?