<commit_before>[//]: # (title: Create a basic coroutine – tutorial)

Kotlin 1.1 introduced coroutines, a new way of writing asynchronous, non-blocking code (and much more). In this tutorial you will go through some basics of using Kotlin coroutines with the help of the `kotlinx.coroutines` library, which is a collection of helpers and wrappers for existing Java libraries.

## Set up a project

### Gradle

In IntelliJ IDEA go to **File** \| **New** \| **Project**.:

![Create a new project](new-gradle-project-jvm.png)

Then follow the wizard steps. You'll have a `build.gradle` file created with Kotlin configured according to [this document](gradle.md).
Make sure it's configured for Kotlin 1.3 or higher.

Since we'll be using the [`kotlinx.coroutines`](https://github.com/Kotlin/kotlinx.coroutines), let's add its recent version to our dependencies:

<tabs>

```groovy
dependencies {
    ...
    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:%coroutinesVersion%'
}
```

```kotlin
dependencies {
    ...
    implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:%coroutinesVersion%")
}
```
</tabs>

This library is published to Bintray Maven Central repository, so add the following:

```groovy
repositories {
    mavenCentral()
}
```

That's it, we are good to go and write code under `src/main/kotlin`.

### Maven

In IntelliJ IDEA go to **File** \| **New** \| **Project** and check the **Create from archetype** box:

![Create a new project](new-mvn-project-jvm.png)

Then follow the wizard steps. You'll have a `pom.xml`  file created with Kotlin configured according to [this document](maven.md).
Make sure it's configured for Kotlin 1.3 or higher.

```xml
<plugin>
    <groupId>org.jetbrains.kotlin</groupId>
    <artifactId>kotlin-maven-plugin</artifactId>
    ...
    <configuration>
        <args>
            <arg>-Xcoroutines=enable</arg>
        </args><commit_msg>Fix typo in coroutines-basic-jvm.md<commit_after>[//]: # (title: Create a basic coroutine – tutorial)

Kotlin 1.1 introduced coroutines, a new way of writing asynchronous, non-blocking code (and much more). In this tutorial you will go through some basics of using Kotlin coroutines with the help of the `kotlinx.coroutines` library, which is a collection of helpers and wrappers for existing Java libraries.

## Set up a project

### Gradle

In IntelliJ IDEA go to **File** \| **New** \| **Project**.:

![Create a new project](new-gradle-project-jvm.png)

Then follow the wizard steps. You'll have a `build.gradle` file created with Kotlin configured according to [this document](gradle.md).
Make sure it's configured for Kotlin 1.3 or higher.

Since we'll be using the [`kotlinx.coroutines`](https://github.com/Kotlin/kotlinx.coroutines), let's add its recent version to our dependencies:

<tabs>

```groovy
dependencies {
    ...
    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:%coroutinesVersion%'
}
```

```kotlin
dependencies {
    ...
    implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:%coroutinesVersion%")
}
```
</tabs>

This library is published to Maven Central repository, so add the following:

```groovy
repositories {
    mavenCentral()
}
```

That's it, we are good to go and write code under `src/main/kotlin`.

### Maven

In IntelliJ IDEA go to **File** \| **New** \| **Project** and check the **Create from archetype** box:

![Create a new project](new-mvn-project-jvm.png)

Then follow the wizard steps. You'll have a `pom.xml`  file created with Kotlin configured according to [this document](maven.md).
Make sure it's configured for Kotlin 1.3 or higher.

```xml
<plugin>
    <groupId>org.jetbrains.kotlin</groupId>
    <artifactId>kotlin-maven-plugin</artifactId>
    ...
    <configuration>
        <args>
            <arg>-Xcoroutines=enable</arg>
        </args>
{'fraction_non_alphanumeric': 0.12617554858934169, 'fraction_numerical': 0.003134796238244514, 'mean_word_length': 4.0514511873350925, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '5507267', 'n_tokens_mistral': 1288, 'n_tokens_neox': 1169, 'n_words': 411}