<commit_before><!--- Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com> -->
# Installing Play

## Prerequisites

To run the Play framework, you need [JDK 6 or later](http://www.oracle.com/technetwork/java/javase/downloads/index.html). 

> If you are using MacOS, Java is built-in. If you are using Linux, make sure to use either the Sun JDK or OpenJDK (and not gcj, which is the default Java command on many Linux distros). If you are using Windows, just download and install the latest JDK package.

Be sure to have the `java` and `javac` commands in the current path (you can check this by typing `java -version` and `javac -version` at the shell prompt). 

## Install Activator

Play is distributed through a tool called [Typesafe Activator](http://typesafe.com/activator).  Typesafe Activator provides the build tool (sbt) that Play is built on, and also provides many templates and tutorials to help get you started with writing new applications.

Download the latest [Activator distribution](https://typesafe.com/platform/getstarted) and extract the archive to a location where you have both read **and write** access. (Running `activator` writes some files to directories within the distribution, so don't install to `/opt`, `/usr/local` or anywhere else you’d need special permission to write to.)

## Add the activator script to your PATH

For convenience, you should add the Activator installation directory to your system `PATH`. On UNIX systems, this means doing something like:

```bash
export PATH=/path/to/activator:$PATH
```

On Windows you’ll need to set it in the global environment variables. This means update the `PATH` in the environment variables and don't use a path with spaces.

> If you’re on UNIX, make sure that the `activator` script is executable.
> 
> Otherwise do a:
> ```bash
> chmod a+x /path/to/activator
> ```

> If you're behind a proxy make sure to define it with `set HTTP_PROXY=http://<host>:<port>` on Windows or `export  HTTP_PROXY=http://<host>:<port>` on UNIX.

## Check that the activator command is available

From a shell, launch the `activator -help` command. 

```bash
$ activator -help
```

If everything is properly installed, you should see the basic help:

[[images/activator.png]]

You are now ready to create a new Play application.<commit_msg>Applying some simplifications mentioned in #4204<commit_after><!--- Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com> -->
# Installing Play

## Prerequisites

You need to have a JDK 1.8 (or later) installed on your machine (see [General Installation Tasks](#jdk-installation)).

## Install Activator

* **Download** the latest [Typesafe Activator](http://typesafe.com/activator).
* **Extract** the archive on a location where you have write access.
* **Open** a command window and enter.

```
cd activator*
activator ui
```

[http://localhost:8888](http://localhost:8888) - here you can access your local Play installation.

You'll find documentation and a list of application samples which get you going immediately. For a simple start, try the **play-java** sample.

### Command Line

To use play from any location on your file-system:
* Add the **activator** directory to your path (see [General Installation Tasks](#add-executables-to-path)).

Creating `my-first-app` based on the `play-java` template is as simple as:
```
activator new my-first-app play-java
cd my-first-app
activator run
```

[http://localhost:9000](http://localhost:9000) - access your application here.


You are now ready to work with Play!

## General Installation Tasks

You may need to deal with those general tasks in order to install Play! on your system. 

### JDK installation

Verify if you have a JDK (Java Development Kit) Version 1.8 or later on your machine. Simply use those commands to verify:

```bash
java -version
javac -version
```

If you don't have the JDK, you have to install it:

* **MacOS**, Java is built-in, but you may have to [Update to the latest](https://www.java.com/en/download/help/mac_install.xml)
* **Linux**, use either the latest Oracle JDK or OpenJDK (do not use not gcj). 
* **Windows** just download and install the [latest JDK](http://www.oracle.com/technetwork/java/javase/downloads/index.html) package.


 
### Add Executables to Path

For convenience, you should add the Activator installation directory to your system `PATH`.

**Unix**

```bash
export PATH=/path/to/activator:$PATH
```



**Windows**

Add `;C:\path\to\activator` to your `PATH` environment variable. Don't use a path with spaces.

### File Permissions

**Unix**

Running `activator` writes some files to directories within the distribution, so don't install to `/opt`, `/usr/local` or anywhere else you’d need special permission to write to.

Make sure that the `activator` script is executable. If it's not, do a `chmod u+x /path/to/activator`.

### Proxy Setup

If you're behind a proxy make sure to define it with `set HTTP_PROXY=http://<host>:<port>` on Windows or `export  HTTP_PROXY=http://<host>:<port>` on UNIX.

{'fraction_non_alphanumeric': 0.10645481628599801, 'fraction_numerical': 0.00814299900695134, 'mean_word_length': 4.374599786552828, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 23, 'https://': 2, 'lorem ipsum': 0, 'www.': 5, 'xml': 1}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7143676', 'n_tokens_mistral': 1530, 'n_tokens_neox': 1424, 'n_words': 663}