title: Node js : spawn throws error in linux
body: <p>The following is my code, It works in windows with out error but when I setup my project in server (linux) it is  not working and throws error</p>
  
  <pre><code>var spawn = require('child_process').spawn,
     javaCmd= spawn('java', ['-cp',__dirname+'/Java/jdk1.7.0_45/lib/dom4j.jar;'+__dirname+'/Java/jdk1.7.0_45/lib/geronimo-stax-api_1.0_spec-1.0.1.jar;'+__dirname+'/Java/jdk1.7.0_45/lib/gson-2.2.4.jar;'+__dirname+'/Java/jdk1.7.0_45/lib/mysql-connector-java-5.1.6.jar;'+__dirname+'/Java/jdk1.7.0_45/lib/ooxml-schemas-1.0.jar;'+__dirname+'/Java/jdk1.7.0_45/lib/poi-3.9-20121203.jar;'+__dirname+'/Java/jdk1.7.0_45/lib/poi-ooxml-3.9.jar;'+__dirname+'/Java/jdk1.7.0_45/lib/xmlbeans-2.5.0.jar;'+__dirname+'/Java/jdk1.7.0_45/lib/xmlbeans-xmlpublic-2.6.0.jar;'+__dirname+'/Java/jdk1.7.0_45/lib/excelreader.jar',  'astral.excelreader.Main', catid, id,target_path]);
  
  
   javaCmd.stdout.on('data', function (data) {
  
          console.log(data);
    });
   javaCmd.stdout.on('close', function(code) {
      console.log(code);
    });
   javaCmd.stderr.on('data', function (data) {
  
          console.log(data);
    });
  </code></pre>
  
  <p>Following is the error</p>
  
  <pre><code>events.js:72
          throw er; // Unhandled 'error' event
                ^
  Error: spawn ENOENT
      at errnoException (child_process.js:980:11)
      at Process.ChildProcess._handle.onexit (child_process.js:771:34)
  </code></pre>
  
  <p>Anybody know its reason? I did n't set any other path for java. I tried to set using <code>$ vi ~/.bash_profile</code> but I got the following response</p>
  
  <pre><code>-bash: $: command not found
  </code></pre>
  
  <p>Anybody know how to set path in linux server</p>