Closed lerouxrgd closed 4 years ago
The main problem in class file parser.
Could you please send me this jar?
Hi,
Here is the jar I used.
2013/12/4 Yaroslav Gaponov notifications@github.com
The main problem in class file parser.
Could you please send me this jar?
— Reply to this email directly or view it on GitHubhttps://github.com/YaroslavGaponov/node-jvm/issues/22#issuecomment-29791957 .
Hi,
I tried to use the following java code : https://github.com/tcurdt/lzo-index/tree/master (complied jar file with maven)
I wanted to use it like this :
var JVM = require("node-jvm"); var jvm = new JVM(); jvm.setLogLevel(7); var entryPointClassName = jvm.loadJarFile("./lzo-index-0.1.jar"); jvm.setEntryPointClassName(entryPointClassName); jvm.on("exit", function(code) { process.exit(code); }); jvm.run(["file.lzo"]);
I got the following error :
DEBUG: loading ./lzo-index-0.1.jar@org/vafer/lzo/Main.class ...
/home/raru/dev/js/test/node_modules/node-jvm/libs/util/reader.js:0
^ RangeError: Trying to access beyond buffer length at checkOffset (buffer.js:582:11) at Buffer.readUInt16BE (buffer.js:616:5) at Reader.read16 (/home/raru/dev/js/test/node_modules/node-jvm/libs/util/reader.js:22:27) at getClassImage (/home/raru/dev/js/test/node_modules/node-jvm/libs/classfile/classarea.js:252:46) at new module.exports (/home/raru/dev/js/test/node_modules/node-jvm/libs/classfile/classarea.js:15:27) at Classes.loadClassBytes (/home/raru/dev/js/test/node_modules/node-jvm/libs/classes.js:47:21) at /home/raru/dev/js/test/node_modules/node-jvm/libs/classes.js:85:22 at Array.forEach (native) at Classes.loadJarFile (/home/raru/dev/js/test/node_modules/node-jvm/libs/classes.js:81:16) at JVM.loadJarFile (/home/raru/dev/js/test/node_modules/node-jvm/libs/jvm.js:81:20) at Object. (/home/raru/dev/js/test/java/java.js:5:31)
at Module._compile (module.js:456:26)
Does the support for jar file depends on how you compile it ?