Avatar.js binaries are published to maven.java.net. The jar is published as avatar-js separately from the platform-specific native libraries published as libavatar-js. These binaries are subject to the project license.

Running apps using Avatar.js

  1. Download Avatar.js jar and native library for your platform from the links above.

  2. Rename the native library, removing the platform and version. For example,

    mv libavatar-js-linux-x64-0.10.32-SNAPSHOT.so libavatar-js.so (linux)
    mv libavatar-js-macosx-x64-0.10.32-SNAPSHOT.dylib libavatar-js.dylib (mac)
    mv libavatar-js-win-x64-0.10.32-SNAPSHOT.dll avatar-js.dll (windows)

  3. Setup your environment so that native libraries can be found (optional, set java.library.path otherwise)

    export LD_LIBRARY_PATH=$PWD:$LD_LIBRARY_PATH (linux)
    export DYLD_LIBRARY_PATH=$PWD:$DYLD_LIBRARY_PATH (mac)
    export PATH=%CWD%;%PATH% (windows)

  4. Run using java -jar ..., setting java.library.path if skipping step 3, for example -

    java -jar avatar-js-<platform>-<version>.jar app.js
    or
    java -Djava.library.path=. -jar avatar-js-<platform>-<version>.jar app.js
    or
    java -Xmx4g -Djava.library.path=. -jar avatar-js-<platform>-<version>.jar app.js
    or
    java -Dnashorn.args='--optimistic-types=true' -Djava.library.path=. -jar avatar-js-<platform>-<version>.jar app.js

Back to top