User avatar Avatar.js and Project

In the context of Java 8 and Nashorn, I see two projects that are regularly mentioned.

Avatar.js and Avatar Project

What is the relationship of these projects?

The .js avatar has very little documentation. As I understand it, it offers the ability to run node applications on the JVM.

The project avatar seems to be based on Avatar.js. However, visibility of scope is to provide an alternative Web-Framework for Java EE 7. Is it also possible to run node programs (like grunt) with Project Avatar?

+8
java java-8 nashorn avatarjs project-avatar
source share
3 answers

Update: Project avatar officially stopped on 2015-02-12.

Avatar.js is an open source version of what is informally called "node.jar" (see this post from the avatar-js mailing list). In other words, it is a NodeJS-compatible API running on Nashorn. Project Avatar is presented by Oracle as a response to the NodeJS API, offering an alternative platform that also provides compatibility with the NodeJS API and ecosystem through Avatar.js.

Therefore, this does not mean that Project Avatar is built on Avatar.js, but rather that "Avatar.js is one of the components of Project Avatar. Nashorn is the JavaScript engine used to run both." (again, from this post ).

The Avatar.js page currently has a list of modules that are known to run, including "grunt". It looks like Project Avatar currently includes the Avatar.js build as "avatar-js.jar" found in the current last commit , although it's 4 months old. So I think the answer is yes, the current build of Project Avatar will allow you to run Node packages.

As you have already indicated, both of these initiatives are not documented and are in their infancy. Community time and involvement will show where they are best suited.

+10
source share

Indeed, Project Avatar has Avatar.js. Looking at the Maven Project Avatar MOM files, I found that there is a binary distribution of Avatar.js available through the java.net Maven repository.

Based on this discovery, I wrote a blog post on how to run simple Node.js applications with Avatar.js here: Running Node.js applications on the JVM using Nashorn and Java 8

The steps for OSX are repeated here:

+7
source share

Project avatars really get the better of Avatar.js ; The code is integrated into our assembly using Maven. (The box you found, Johann, was old because we no longer use it - I just made it public, thanks).

And yes, we know that our documents require more work. We are currently focusing on creating a server-side JavaScript platform. This service level provides a runtime environment that is configured to easily create REST, WebSocket, and Server-Sent event endpoints.

+3
source share

All Articles