• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Tim Cooke
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
Saloon Keepers:
  • Piet Souris
Bartenders:

Java ScriptEngine cannot find module referenced by Javascript file

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using Java 7, and I have the following code that uses the jsondiffpatch Javascript library:



If you look at line 48 of jsondiffpatch.js (the uncompressed version of jsondiffpatch.min.js), you can see it references another module:



When executing the Java code, the "engine.eval(reader)" line can't find package.json and throws the following exception:



The jsondiffpatch.min.js file is located in the webclient/common/js directory, and the package.json file is located in the webclient/common directory.

The "logger.debug" line printed out the following for the current working directory:



So I tried copying the package.json file to the /usr/local/project/version directory, and I still got the same exception.

Why can't the ScriptEngine find the package.json file?
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic