Set up Java local development

It is possible to carry out local development of Transforms Java repos, allowing for high-speed iterative development.

Setting up local development for Java transforms repositories

Clone the repository

  1. In your repository’s menu bar, select Work locally and copy the repository URI, also referred to as the "git remote URL".

The repository URI (git remote URL) contains sensitive information linked to your account and should not be shared. To maintain platform security, do not share this link with anyone else or post it publicly.

The option to clone your in-platform repository. The "Work locally" dialog.

  1. Using the command line, run git clone <URI> on your local machine in a directory of your choice. Then use the cd command to navigate to the repository.

Limitations

  • The token granted for cloning is short-lived and read-only, with the exception of pushing back to your repository.
  • You will still need to push your changes to Foundry to publish job specs or artifacts, or if you wish to run checks or build.

Preview

Dataset Previews are supported in local development. See Local preview for more details.

Set up the development environment

Prerequisites

  • Ensure Java 17 is installed and the environment variable JAVA_HOME points to the right Java installation. You can download Java 17 from the Oracle website ↗.

Setting the JAVA_HOME environment variable based on your operating system:

  • Windows: Run SETX JAVA_HOME -m "<java-home-dir>" in PowerShell. This modifies the system environment variable and you will need to restart the shell for changes to take effect. Alternatively you can run [System.Environment]::SetEnvironmentVariable("JAVA_HOME", "<java-home-dir>") to set JAVA_HOME in the running process.
  • Linux or macOS: Run export JAVA_HOME=<java-home-dir>.
  • Ensure you repository is upgraded to the latest template version by following the steps outline here.

Configure the IDE

  • Install IntelliJ Idea ↗ on your machine.
  • Open up your command line terminal and navigate into the directory containing your repository using cd and run ./gradlew openIdea. This Gradle task will generate an IntelliJ Idea project and open it.
    • On Windows, the ./gradlew openIdea command must be run from Git BASH, which is included in Git for Windows ↗.

Limitations

  • Gradle commands must be run from the terminal using ./gradlew, rather than using IntelliJ's Gradle plugin.
  • Local development works with Java versions up to Java 17, and does not currently support any higher Java versions.