<commit_before># Nexmo Quickstart Examples for Java

Quickstarts also available for: [.NET](https://github.com/nexmo-community/nexmo-dotnet-quickstart), [Node.js](https://github.com/nexmo-community/nexmo-node-quickstart), [PHP](https://github.com/nexmo-community/nexmo-php-quickstart), [Python](https://github.com/nexmo-community/nexmo-python-quickstart), [Ruby](https://github.com/nexmo-community/nexmo-ruby-quickstart)
  
The purpose of the quickstart guide is to provide simple examples focused on
one goal. For example, sending an SMS, handling an incoming SMS webhook,
making a Text to Speech call.

## Setup

To use this sample you will first need a [Nexmo account][sign-up].

For some of the examples you will need to [buy a number][buy-number].

## Building The Library

You will need to have [Gradle](gradle) installed to build the code. Once
you have gradle installed, run the following to build a jar that contains
the quickstart code along with all the nexmo client library dependencies:

```sh
gradle assemble
```

This will build the following file: `build/libs/nexmo-java-quickstart-with-dependencies.jar`

## Running The Examples

Copy `.env-example` to `.env` and edit the values. You'll need to load those
values into environment variables, so you'll probably want to use a tool like
[Foreman](foreman) to run your code like this:

```sh
foreman run java -cp build/libs/nexmo-java-quickstart-with-dependencies.jar CLASS
```

So to run the OutboundTextToSpeechExample class, you would run the following:

```sh
foreman run java -cp build/libs/nexmo-java-quickstart-with-dependencies.jar com.nexmo.quickstart.voice.OutboundTextToSpeech
```<commit_msg>Fix broken link to Foreman (#42)<commit_after># Nexmo Quickstart Examples for Java

Quickstarts also available for: [.NET](https://github.com/nexmo-community/nexmo-dotnet-quickstart), [Node.js](https://github.com/nexmo-community/nexmo-node-quickstart), [PHP](https://github.com/nexmo-community/nexmo-php-quickstart), [Python](https://github.com/nexmo-community/nexmo-python-quickstart), [Ruby](https://github.com/nexmo-community/nexmo-ruby-quickstart)
  
The purpose of the quickstart guide is to provide simple examples focused on
one goal. For example, sending an SMS, handling an incoming SMS webhook,
making a Text to Speech call.

## Setup

To use this sample you will first need a [Nexmo account][sign-up].

For some of the examples you will need to [buy a number][buy-number].

## Building The Library

You will need to have [Gradle](gradle) installed to build the code. Once
you have gradle installed, run the following to build a jar that contains
the quickstart code along with all the nexmo client library dependencies:

```sh
gradle assemble
```

This will build the following file: `build/libs/nexmo-java-quickstart-with-dependencies.jar`

## Running The Examples

Copy `.env-example` to `.env` and edit the values. You'll need to load those
values into environment variables, so you'll probably want to use a tool like
[Foreman](https://github.com/ddollar/foreman) to run your code like this:

```sh
foreman run java -cp build/libs/nexmo-java-quickstart-with-dependencies.jar CLASS
```

So to run the OutboundTextToSpeechExample class, you would run the following:

```sh
foreman run java -cp build/libs/nexmo-java-quickstart-with-dependencies.jar com.nexmo.quickstart.voice.OutboundTextToSpeech
```
{'fraction_non_alphanumeric': 0.10443786982248521, 'fraction_numerical': 0.000591715976331361, 'mean_word_length': 4.900523560209424, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 11, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1287346', 'n_tokens_mistral': 1050, 'n_tokens_neox': 978, 'n_words': 365}