For more information, see - Java Install Guide
- Create an application at https://portal.ditto.live/. Make note of the Database ID and development token.
- Copy the
.env.samplefile at the top level of thequickstartrepo to.envand add your Database ID and development token. - Synchronize your project with the Gradle file by clicking Build > Sync Project with Gradle Files.
- Open a terminal and run the following command to launch the app:
./gradlew bootRun
- Open http://localhost:8080 in a browser to interact with the app.
The Maven variant reuses this directory's application sources. From
quickstart/java-server, load the values from the quickstart root .env and
build with:
set -a
. ../.env
set +a
./java-spring-maven/mvnw -f java-spring-maven/pom.xml package -DskipTestsThe Maven build embeds the three Ditto values in its generated configuration class. If the environment variables are unset, empty values allow compilation.