Thursday, 16 March 2017

How to run a jar file with in node js application on bluemix

I had a node js application where Im trying to run a jar file and get the result.I succeeded using this code.

var exec = require('child_process').exec;
var child = exec('java -jar ./helloworld.jar',
function (error, stdout, stderr){
    console.log(jardata,"jar out...");
    if(error !== null){
        console.log("Error -> "+error);
    }

But this is working good in my local system.But when I do a cf push of this app to bluemix.App got deployed but it is giving me an error java: not found when it is trying to run jar file.So it is possible to install java with in node js application or how can we do this on bluemix running a jar with in node js application..Any help appreciated!!



via user7350714

No comments:

Post a Comment