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

1.8k views Asked by At

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

There are 1 answers

1
DJCordhose On BEST ANSWER

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