Nice to meet you. Glad that you want to learn more about using docToolchain. Start by installing what you need.

The following steps are the same as described in the User Docs. Please follow them step by step. You are prompted to install everything you need for each step.

If you encounter problems, create a GitHub issue and the community will help you.

Installing docToolchain

Bennykillua Ralf D. Müller Jérémie Bresson T8xi Michael Krauße Ralf D. Müller stehlih Dr. Stefan Pfeiffer Alexander Schwartz feinstaub Jakub J Jablonski jakubjab Jorge Dr. Gernot Starke Lars Francke

5 minutes to read

Getting the Wrapper

The way docToolchain is installed has changed since the v2.x release. It now uses a simple wrapper script which takes care of everything.

This wrapper helps by:

  • Ensuring that everyone using your repository uses the same docToolchain version.

  • Keeping all docToolchain technology out of your repository.

  • Wrapping your commands and directing them to your local installation.

  • Checking your docToolchain installation (if not installed, the wrapper will do it for you via direct download or Docker).

This guide explains how to set up docToolchain in the following environments:

  • A Linux/WSL2 with bash

  • Windows with PowerShell

  • Windows with cmd.exe

Please select the appropriate setup and follow these instructions to install docToolchain step by step.

Linux / WSL2 with bash
cd <your project>
wget doctoolchain.github.io/dtcw
chmod +x dtcw

if you don’t have wget installed, you can also use curl:

cd <your project>
curl -Lo dtcw doctoolchain.github.io/dtcw
chmod +x dtcw
Windows with Powershell
cd <your project>
Invoke-WebRequest doctoolchain.github.io/dtcw.ps1 -Outfile dtcw.ps1
Windows with cmd.exe
cd <your project>
curl -Lo dtcw.bat doctoolchain.github.io/dtcw.bat
dtcw.bat wraps the dtcw.ps1 script and executes it in powershell. This might be easier to use if you haven’t yet configured your powershell as a developer.
In order to support development for your project on both, Linux and Windows, it makes sense to download all three scripts to your project.
if you use cmd.exe, follow the PowerShell instructions but replace .ps1 with .bat.
dtcw uses bash as shell and thus tries to find java from within bash. Chances are that when you use dtcw from another shell like zsh, you shell knows about the right java version but your bash doesn’t. In that case, please switch to bash and make sure that the right java version is known. Afterwards, you can switch back to your shell.

Running your First Command

To get started with docToolchain, run tasks as the first command:

Linux / WSL2 with bash
./dtcw tasks --group=doctoolchain
Windows with Powershell
./dtcw.ps1 tasks --group=doctoolchain
if using cmd.exe replace .ps1 with .bat for all subsequent commands.

This command shows all docToolchain tasks and verifies that docToolchain is installed by doing the following:

  • Checking for a configuration file (and create one if none exist). Prefers a local installation.

  • Making use of Docker (if available) where there is no local installation.

If this is your first time installing docToolchain, the images download might take a while.
  • if docker is not available, it will download and install docToolchain to your home folder

    • it will then run a gradle build through the gradle wrapper. If this is your first time, it will download and install gradle.

    • the gradle build will also fetch some dependencies. This will also take a while if run for the first time..

You’ll notice the installation is an incremental process and will take a while because of all the additional dependencies needed. After the first few commands, you’ll have all the required dependencies installed and things will run faster.

Problems & solutions

dtcw doesn’t run

You might get an error similiar to this one:

./dtcw local tasks --group=doctoolchain
./dtcw: line 1: syntax error near unexpected token `newline'
./dtcw: line 1: `<!DOCTYPE html>'

If you see that, it’s likely that the wrapper didn’t download correctly. You can expect that an HTML page was downloaded instead of the wrapper. Please try to redownload the wrapper.

docker throws and error with dtcw

On windows you might get the following error

Error response from daemon: user declined directory sharing C:\Users\path_to_my_folder

This means that docker wanted to share the named folder (possibly the repo) but didn’t have the rights. This means you have to share the folder yourself on docker. Go to docker dashboard → settings → Resources → FileSharing. Add required folder and hit Apply & Restart.

Incompatible Java version

You may see that docToolchain starts but crashes with a stacktrace that starts like this:

* What went wrong:
Could not compile settings file '/Users/falk/.doctoolchain/docToolchain-2.0.0/settings.gradle'.
> startup failed:
  General error during semantic analysis: Unsupported class file major version 61

  java.lang.IllegalArgumentException: Unsupported class file major version 61

In this case, you’ve got an incompatible version of Java. dtcw tries to check the Java version up front by running java --version, but Gradle sometimes picks up a different version. If you get a similar error, try reinstalling a compatible Java version.