Skip to content
Yaroslav Gaponov edited this page Nov 15, 2013 · 10 revisions

Short help

Class JVM

Methods:

  • void setEntryPointClassName(className)
  • void setEntryPointMethodName(methodName)
  • void setLogLevel(level)
  • ClassArea loadClassFile(fileName)
  • void loadClassFiles(dirName)
  • ClassArea loadJSFile(fileName)
  • void loadJarFile(fileName)
  • void run(arguments)

Log Levels

  • DEBUG = 1
  • ERROR = 2
  • INFO = 4
  • WARN = 8

Example

var JVM = require("node-jvm");
var jvm = new JVM();
jvm.setLogLevel(7); 
var entryPointClassName = jvm.loadJarFile("./Main.jar");
jvm.setEntryPointClassName(entryPointClassName);
jvm.on("exit", function(code) {
    process.exit(code);
});
jvm.run([15]);
Clone this wiki locally