> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ditto.live/llms.txt
> Use this file to discover all available pages before exploring further.

# Java Server Quickstart

> Get started quickly with Ditto using the Ditto Quickstart Applications

## Prerequisites

Following are the minimum requirements that must be met before attempting to install Ditto.

* Java Development Kit (JDK) version 17 or later

* One of the following platforms and architectures:
  * Windows x86\_64
  * Linux x86\_64
  * macOS arm64 (Apple Silicon)

- [Git](https://git-scm.com/) installed on your machine
- A Ditto [Portal](https://portal.ditto.live) account with a configured Ditto Database (see [Getting SDK Connection Details](https://docs.ditto.live/cloud/portal/getting-sdk-connection-details.md))

## Get Started

### 1. Clone the Repository

<ol><li>Open the terminal</li>
<li>Clone the repository from GitHub.
<pre>`git clone https://github.com/getditto/quickstart`</pre></li>
<li>Navigate to the project directory:
<pre>`cd quickstart`</pre></li></ol>

### 2. Configure Ditto

#### Get Ditto Database ID, Development Token, and Server URL

In the Ditto Portal, open your database and get its **Database ID** and **Development Token**. Copy the **URL** shown under "Connect via SDK" for `DITTO_SERVER_URL`. See [Getting SDK Connection Details](https://docs.ditto.live/cloud/portal/getting-sdk-connection-details.md) for details.

#### Add Ditto Credentials

1. From the `quickstart` repository root, copy `.env.sample` to `.env` and add your database ID, development token, and server URL.
   ```shell theme={null}
   cp .env.sample .env
   ```
2. Set these values in `.env` using the connection details for your Ditto Database:
   ```shell theme={null}
   DITTO_DATABASE_ID="REPLACE_ME_WITH_YOUR_DATABASE_ID"
   DITTO_DEVELOPMENT_TOKEN="REPLACE_ME_WITH_YOUR_DEVELOPMENT_TOKEN"
   DITTO_SERVER_URL="REPLACE_ME_WITH_YOUR_URL"
   ```

### 3. Run the Application

1. Open a terminal app and navigate to the `java-server` directory.
2. Run the following command to launch the web app:
   ```shell theme={null}
   ./gradlew bootRun
   ```
3. Open [http://localhost:8080](http://localhost:8080) in a browser to interact with the app.

### 4. Sync-Data Offline

<ol><li>Launch the application on multiple devices or simulators</li>
<li>Disconnect from your current WiFi network while keeping WiFi enabled on the device to allow for LAN connections</li>
<li>Add, edit, and delete tasks and experience offline collaboration!</li></ol>

## Next Steps

All the Ditto Quickstart apps work together! Try running a quickstart app in other languages and see them all collaborate.

## Additional Resources

* [Java Install Guide](https://docs.ditto.live/sdk/latest/install-guides/java/server.md)
* [Java Release Notes](https://docs.ditto.live/sdk/latest/release-notes/java)
* [API Reference](https://software.ditto.live/java/ditto-java/5.2.0/api-reference/)


## Related topics

- [Java for Servers & Desktop](https://docs.ditto.live/sdk/latest/install-guides/java/server.md)
- [JavaScript Web Quickstart](https://docs.ditto.live/sdk/latest/quickstarts/javascript-web.md)
- [JavaScript Console App Quickstart](https://docs.ditto.live/sdk/latest/quickstarts/javascript-console.md)
