title: nodejs service -in windows system ,unable to execute jar files
body: <p>I have Nodejs - server.js code in my windows system from which i  want to execute a simple jar file.</p>
  
  <p>So i used follwoing code :</p>
  
  <pre><code>   cmd = "java -jar C:\\libs\\sample.jar";
  
     var Exec =exec(cmd, function(error, stdout, stderr) {
  
     if (error !== null) {
  
     console.log('exec error: ' + error);
  
     }//end of if
  
     });//end of exec cmd
  </code></pre>
  
  <p>When i run the "node server.js" in command prompt ,jar is executing perfectly.</p>
  
  <p>After this i made this "node server.js" command as service by referring following link :</p>
  
  <p><a href="https://github.com/coreybutler/node-windows" rel="nofollow">https://github.com/coreybutler/node-windows</a></p>
  
  <p><strong>i.e node-windows,But now once its become service i am unable to exectue simple.jar,even i am enble to run simple "java -version" command.</strong></p>
  
  <p>Except java all other command are working fine even after i made nodejs as service.</p>
  
  <p>Please help me out.....</p>
  
  <p><strong>New Update : After testing lot of different cases, Finally i came to know that jars containing JFrame components is not opening...how to solve this</strong> </p>