Get the Avail Source
A source distribution of Avail is available for users of Windows, Mac OS X, Linux, and other Unix systems. A source distribution is obtained by cloning the official Avail project repository. The following instructions are provided using a Unix terminal. Windows users will need to make the appropriate adjustments to dereference environment variables.
A Git client is required to clone the project repository. If you do not already have one installed, then you can obtain one here. We have noticed that the Git binaries for Mac OS X are sometimes mislinked on older versions of the operating system (< 10.9.x); if you encounter this problem, then uninstall the Git client and install Xcode to obtain a properly linked build of Git.
The Avail project repository is located at:
The following branches correspond to supported Avail project releases:
You can obtain a specific release using the following command:
$BRANCH_NAME stands for one of the branch names given in the table above. For example, to obtain the
1.4.1 branch, you can issue the following command:
Once you have cloned an Avail project branch, you can stay current with updates to that branch by pulling them from the official repository:
If you obtained a binary distribution of Avail, then run the installer. Afterward, skip ahead to learn about configuration.
If you obtained a source distribution of Avail, the you have more work to do before you can start experimenting with Avail. The official installation instructions are included in the
README.md file of the source distribution:
README.md is a plain text document that contains Unicode code points in the UTF-8 character encoding, so it can be read by most modern editors. As a courtesy to aging developers and system administrators, such as several of the Avail team members, it is manually line-broken to look good on an 80-column display.
If you encounter problems during installation and you discover that there is disagreement between
README.md and the following instructions, then please treat
README.md as gospel.
Before installing Avail, you will need to make sure that you have obtained and installed the prerequisite software:
Java: You will need version 1.8, or later, of the Java Development Kit (JDK). Many modern systems already have some version of the JDK, so you should check your JDK version before obtaining and installing it from Oracle (or some other vendor). You can do so like this:
And hopefully you get back something like this:
Otherwise, the latest version of the Java SE Development Kit 8 can be obtained at:
Please follow any installation directions provided by the Oracle website or included with the JDK.
Please make sure that
javacare on your
Gradle: This is the build software used to compile and install Avail. You do not need to obtain Gradle manually, as the build process will take care of this for you automatically.
You will need to compile Avail using the provided Gradle wrapper. To build Avail on a Unix-based system, such as Linux, Mac OS X, Minimalist GNU for Windows (MinGW), or Windows Subsystem for Linux (WSL):
To build Avail on vanilla Windows:
$PROJ is the location of your local copy of the Avail project repository. You should see output similar to this:
If your transcript includes
BUILD SUCCESSFUL near the end, then your build is ready for use. You may, of course, move the
distro subdirectory to another user-specific or even system-wide location, and then update your
PATH variables accordingly. Hereinafter we use $INSTALL to refer to the final destination of the
In order to develop Avail libraries and programs, you will need to configure your environment appropriately. On Unix, this is best accomplished by updating your shell configuration file. On Windows, you can use the Control Panel to adjust the environment variables.
The following steps should be taken to prepare your environment for Avail development:
- Set the
AVAIL_HOMEenvironment variable to
$INSTALL. (You will need to put
$INSTALLin quotation marks
(U+0022)if it contains spaces
(U+0020).) The Avail workbench,
avail-devon Unix and
avail-dev.baton vanilla Windows, uses this information to locate Avail, and will not run correctly without
- Update your
$INSTALL/bin. (Again, on Unix systems you will need to put
$INSTALLin quotation marks if it contains spaces.) This is where
avail-dev.batare located. This enables your shell to find the command without the user needing to prefix its exact path or change the working directory.
- Set the
AVAIL_ROOTSenvironment variable to a valid module roots path so that Avail can find its modules, or …
- … alternatively, you may start the Avail workbench without specifying
AVAIL_HOMEand use the Preferences… menu item to enter the module roots path, one module root at a time. Upon exiting the Avail workbench, this information is persisted for future sessions.
A module roots path is a specification of locations that contain Avail code, in either binary or source form. A module roots path comprises several module root specifications separated by semicolons
(U+003B). (On Unix systems, you will need to put each semicolon in apostrophes
(U+0027), in order to hide it from the shell's command parser.)
Each module root specification comprises a module root name, which is just a unique logical identifier, and a module root path. A module root name usually denotes a vendor or a project, and does not need to have any relationship to the file system. By convention, the module root name of the Avail standard library is
avail, and the official collection of examples supported by The Avail Foundation is called
examples. The Avail Foundation advises Avail developers to follow a reverse DNS name convention, like
com.acme.super-neato-project, to prevent collision between module root names among several vendors and projects.
A module root path is actually a conjunction of a binary repository path and a source module path, respectively, separated by a comma
(U+002C). A binary repository path locates a binary file that contains the compiled forms of Avail source modules. A source module path locates a directory containing Avail source modules. The same binary repository path may be used for many source paths. If a binary repository path does not refer to an existing file, then
avail-dev will create and populate this file as needed. A source path must always refer to an existing directory that is readable by the user running
AVAIL_ROOTS is not defined, then
avail-dev will use the following module
roots path by default:
This default is suitable for interacting with the Avail system as shipped by The Avail Foundation, but not for developing your own Avail modules. To develop your own Avail modules, your
AVAIL_ROOTS environment variable must at least include a module root specification for the Avail standard library, and it must also include module root specifications for your own Avail projects.
avail-dev.bat makes no effort to configure the environment. You must preconfigure the environment yourself, customize
avail-dev.bat to suit your own needs, or use the Avail workbench to establish the module roots. (A lack of Windows expertise on the part of The Avail Foundation is responsible for this minimality; hopefully
avail-dev.bat will be richer in a future release.)
For more information on this topic, please read about module discovery.
If you installed a binary distribution of Avail, then you can launch the Avail workbench by double-clicking on the application's icon.
If you installed a source distribution of Avail, then you can launch the Avail workbench like this:
If you are launching the Avail workbench from a Windows command prompt, then be aware that the name of the batch script is
Once you've launched the workbench, have a look at the Avail workbench documentation, which includes a tour of the UI and features.
|Back to the top|