title: java.lang.NoClassDefFoundError at runtime when using express framework and node.js
body: <p>I am trying to write a sample code to create an instance of a java class and then invoke a method using that instance. I am using node-java module to do this. The code compiles without any error. However when I hit the URL which actually hits the same code then I get the class not found exception. </p>
  
  <p>I have verified that the jar and it is there in the same directory as index.js and the jar also contains the class file (Application.class) for which the instance is being created.</p>
  
  <p>My index.js file</p>
  
  <pre><code>var java = require("java");
  java.classpath.push("demo.jar");
  
  var express = require('express');
  var router = express.Router();
  var Application = java.import('Application');
  
  /* GET home page. */
  router.get('/', function(req, res) {
  var application = new Application();
  var resp = application.getResponse();
  res.render('index', { title: resp });
  });
  
  module.exports = router;
  </code></pre>