Book Image

haXe 2 Beginner's Guide

5 (1)
Book Image

haXe 2 Beginner's Guide

5 (1)

Overview of this book

Table of Contents (21 chapters)
haxe 2
Credits
Foreword
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Installing haXe


Enough talking, let's install haXe! You will see how easy it is.

Two ways to install: The installer and sources compilation

You should know that there are two ways to install haXe, which are as follows:

  1. Using the installer: An executable that will automatically install haXe for you.

  2. Compiling from sources using the code repository located at the following URL:

    http://code.google.com/p/haxe

One important thing to note is that haXe can be installed on on Windows, Linux, and MacOSX. This way, you don't have to worry about your operating system and can continue working in your environment.

Installing on Windows

Installing haXe on Windows is pretty easy, but there are some caveats that we should avoid.

So, carry out the following steps:

  1. Go to http://www.haxe.org.

  2. Click on the Download link.

  3. There, you will find a link to download the Windows version of the installer. It comes as an executable file.

  4. Run the executable.

Note that if you're working on Windows Vista or Windows 7, you will need to run the executable as Administrator. You can do so by right-clicking on the installer while holding the Shift key down and then clicking on Run as Administrator.

Installing on MacOSX

Installing haXe on MacOSX is very straightforward. Carry out the following steps:

  1. Go to http://www.haxe.org.

  2. Click on the Download link.

  3. There, locate and click on the link to download the OSX Universal Installer.

  4. The installer comes as a DMG image, if it's not automatically mounted; mount it by double-clicking on it.

  5. Go to where the DMG image is mounted and run the installer.

That's it! You have haXe installed on MacOSX!

Installing on Linux

Some distributions have haXe in their repositories, so you may install it from your distribution's repository if it's available.

Alternatively, you can use the Linux Installer to install haXe; it does work on many distributions. Carry out the following steps to install haXe on Linux:

  1. Go to http://www.haxe.org.

  2. Click on the Downloads link.

  3. Find the link to download the Linux version of the installer.

  4. Uncompress the file by using the tar –zxf hxinst-linux.tgz command.

  5. Add execution rights on the installer by using the chmod +x hxinst-linux command.

  6. Run the installer with administration rights either by using the sudo –s command or the su command, and then running ./hxinst-linux.

Now, you should have haXe installed on your Linux machine.

Installing nightly builds

If you need features that are not in the latest release, you can use the nightly builds to easily have access to binaries of what is in the repository without the need of compiling it on your own.

You will be able to find them on the haXe website's Download page for your operating system.

Note that the nightly builds do not come with an installer and therefore, you are advised to first install using the installer, so that it sets up all environment variables and then replaces installed files by the ones from the nightly builds archive.

On MacOSX and Linux machines, you should find them in /usr/lib/haxe, while on Windows, they should be in c:\haxe.

Verifying your installation

You can verify that haXe is correctly installed by opening a terminal and running the haxe command; if haXe is correctly installed, then you should get the help message.

You can also test that Neko is correctly installed by running the neko command. You should again get the help message.