Running Node.js on Java 8 Nashorn with Avatar.js on Windows “no avatar-js in java.library.path”

ε祈祈猫儿з 提交于 2019-12-21 03:00:53

问题


For a sandbox project https://github.com/PaulVI/NashornSandbox

I am trying to run helloWorld.js Node.js on Java 8 Nashorn with Avatar.js on Windows like

"C:\Program Files\Java\jdk1.8.0\bin\java" -Djava.library.path=lib -jar lib/avatar-js.jar helloWorld.js

and get "no avatar-js in java.library.path", while it is.

D:\Workspaces\Enide-Studio-2014-011-win64\NashornSandbox>"C:\Program Files\Java\jdk1.8.0\bin\java" -Djava.library.path=lib -jar lib/avatar-js.jar helloWorld.js
Exception in thread "main" java.lang.UnsatisfiedLinkError: no avatar-js in java.library.path
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1838)
        at java.lang.Runtime.loadLibrary0(Runtime.java:870)
        at java.lang.System.loadLibrary(System.java:1116)
        at com.oracle.libuv.LibUV.<clinit>(LibUV.java:33)
        at com.oracle.avatar.js.eventloop.EventLoop.<init>(EventLoop.java:397)
        at com.oracle.avatar.js.Server.<init>(Server.java:158)
        at com.oracle.avatar.js.Server.<init>(Server.java:137)
        at com.oracle.avatar.js.Server.<init>(Server.java:125)
        at com.oracle.avatar.js.Server.main(Server.java:121)


回答1:


Marko is right, renaming to avatar-js.dll and avatar-js-win-x64.dll makes it run on Windows.



来源:https://stackoverflow.com/questions/23130587/running-node-js-on-java-8-nashorn-with-avatar-js-on-windows-no-avatar-js-in-jav

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!