Launch jsdom from Rhino on Java

前端 未结 2 1965
醉话见心
醉话见心 2021-01-15 05:01

I\'m following up on this answer:

I managed to run simple JavaScript code from Rhino Engine on Java.

But when it comes to D3.js, for example:

2条回答
  •  独厮守ぢ
    2021-01-15 05:35

    JsDom might be a bad option since it relies on so many internal features of Node and Google's V8 JavaScript engine. Env.JS should be a better option but if it doesn't work then you're probably out of luck. It might not work because it's essentially a frozen project with last release in 2010. You'll have to either run your JavaScript in Node or Phantom, or generate SVG with Java-based solutions like Apache Batik.

    By the way require in JsDom is not the same as require.js but a build-in Node.js function.

提交回复
热议问题