nodyn/jvm-npm

Java bindings missing

Closed this issue · 1 comments

I am currently depending on jvm-npm using Jitpack. However, even if jvm-npm is on my classpath, there is no way to load the JavaScript file from within my Java code, so that I can use it in Nashorn. Currently I am using Aether to open the JAR from my local Maven repository. However, if there simply was a Java class in jvm-npm that would use getResourceAsStream, I could grab the file like that.

lance commented

We actually do getResourceAsStream here https://github.com/nodyn/jvm-npm/blob/master/src/main/javascript/jvm-npm.js#L257. And you can see a test here. https://github.com/nodyn/jvm-npm/blob/master/src/test/javascript/specs/requireSpec.js#L263

Are you sure the .js is in the current thread context class loader?