> ## 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

export const QuickstartConfigTitleAndDatabaseIdBody = () => <div>
        <ol>
            <li>
                Log in to your <a href="https://portal.ditto.live" target="_blank">Ditto Portal account</a>
            </li>
            <li>
                Navigate to your database and obtain the Ditto <b>Database ID</b>, <b>Playground Token</b>, <b>Auth URL</b>, and <b>Websocket URL</b>.
                (see <a href="/cloud/portal/getting-sdk-connection-details">Getting SDK Connection Details</a> for more details)
            </li>
        </ol>
    </div>;

export const QuickstartSyncDataOfflineBody = () => <div>
        <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>
    </div>;

export const QuickstartCloneTheRepoBody = () => <div>
        <ol>
            <li>Open the terminal</li>
            <li>
                Clone the repository from GitHub.
                <pre>
                    <code>
                        git clone https://github.com/getditto/quickstart
                    </code>
                </pre>
            </li>
            <li>
                Navigate to the project directory:
                <pre>
                    <code>
                        cd quickstart
                    </code>
                </pre>
            </li>
        </ol>
    </div>;

## Prerequisites

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

* Java Development Kit (JDK) version 17 {/* TODO: This should probably change to JDK 11 once we fix build scripts */}

* 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](/cloud/portal/getting-sdk-connection-details))

## Get Started

### 1. Clone the Repository

<QuickstartCloneTheRepoBody />

### 2. Configure Ditto

#### Get Ditto Database ID, Development Token, Auth URL, and Websocket URL

<QuickstartConfigTitleAndDatabaseIdBody />

#### Add Ditto Credentials

1. Copy the `.env.sample` file at the top level of the `quickstart` repo to `.env` and add your database ID and development token.
   ```shell theme={null}
   cp .env.sample .env
   ```
2. Update the `.env` file with the Database ID and Development Token from your Ditto Database
   ```java theme={null}
   DITTO_DATABASE_ID=YOUR_DB_ID
   DITTO_DEVELOPMENT_TOKEN=YOUR_DEV_TOKEN
   DITTO_AUTH_URL=https://YOUR_AUTH_URL
   DITTO_WEBSOCKET_URL=wss://YOUR_AUTH_URL
   ```

### 3. Run the Application

1. Open a terminal app and navigate to the `quickstart/java-spring` 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

<QuickstartSyncDataOfflineBody />

## Next Steps

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

## Additional Resources

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