Project Avatar distributions can be downloaded from the downloads folder.

GlassFish 4.0 logo-gf

Instructions for using Project Avatar with GlassFish Server 4.0

Step 0. Prerequisite Project Avatar requires JDK 8
Step 1. Download
In order to use this distribution with GlassFish Server 4.0, you will need an existing GlassFish Server 4.0 installation.
Step 2. Install
  • Expand the file into the glassfish directory of an existing GlassFish Server 4.0 installation. For Ex.
        unzip -d <workspace>glassfish4/glassfish
    The above command assumes a default installation of GlassFish 4.0 Server.
  • Set AVATAR_HOME environment variable to point to the GlassFish Server directory. In a default GlassFish 4.0 Server installation it is <workspace>/glassfish4/glassfish
  • Add $AVATAR_HOME/bin to your PATH variable.
  • On a Windows machine either use Cygwin or replace "/" with "\"
Step 3. Deploy Project Avatar Application
    avatar new --example=hello
This will create the hello sample application directory.
Start the GlassFish Server and deploy the newly created hello application.
    asadmin start-domain
    asadmin deploy hello

Now, point your browser to http://localhost:8080/hello.

If you edit the hello/view/src/hello.html file while the server is running, Project Avatar will re-compile it on the next request. This feature enables very rapid iteration during development of the application. The debug property in the file can be set to false in production mode, which both disables this feature and causes all .js and .css files to be minimized.

To stop the server, use

    asadmin stop-domain

If you want to look under the hood, we recommend the Chrome developer tools which allow you to step through JavaScript, inspect the DOM, css and more.

Step 4. Project Avatar Examples

The Project Avatar examples application showcases several features of Project Avatar. The examples application can be deployed as follows, and accessed from http://localhost:8080/examples, once deployed:

    asadmin deploy ${AVATAR_HOME}/Project-Avatar-examples/examples.ear

The examples application is large, so to reduce startup time it is a good idea to undeploy it when no longer needed:

    asadmin undeploy examples

The $AVATAR_HOME/Project-Avatar-examples directory also contains various other example applications that can be deployed individually to the application server. More information on the example applications is available here.

Step 5.Check the documentation

Back to top