# This header is for providing additional information to hugo for the website generation it ignored by asciidoctor

title: "Building and Running 4diac IDE" url: doc/development/building4diac.html page_css_file: /4diac/css/4diac_doc.css sidebar: - sb-doc ---

# Building and Running 4diac IDE

You have 2 options for building and running 4diac IDE:

1. Building and Running 4diac IDE from Source

2. Building a Binary 4diac IDE Package from Source

## 1 Building and Running 4diac IDE from Source

Run through the following steps to build and execute the 4diac IDE from source:

1. Get the development environment

2. Check out the 4diac IDE repository

3. Import plug-ins into workspace

4. Set the target platform

5. Run in development mode

### 1.1 Get the Development Environment

The 4diac IDE requires at least a version 21 Java JRE. Higher version JREs are supported, but may require additional Eclipse IDE configuration (see step 4 of chapter Import plug-ins into workspace).

Get the latest Eclipse IDE. Use Eclipse Modeling Tools edition.

In order for all dependencies to resolve correctly, the following additional Eclipse packages are required:

- M2E - Maven Integration for Eclipse

- M2E - PDE Integration

- XText Complete SDK

You can install these packages using your Eclipse IDE by selecting Help → Install New Software (Eclipse Repository).

### 1.2 Check out the 4diac IDE Repository

This section shows how to check out (clone) the 4diac IDE repository. You will need Git to download it by using the `clone` command from Git to the repository `https://github.com/eclipse-4diac/4diac-ide.git`. If you’re using the terminal, do:

    $ cd ~
    $ git clone https://github.com/eclipse-4diac/4diac-ide.git

The code will be copied to the new created folder `~/4diac-ide`.

You can also use the git integrated into Eclipse for this process. Please refer to the Eclipse EGit documentation on how to clone a repository.

Once you have cloned the repository make sure that you switch to the `develop` branch. The default branch, `release`, might be out of date and thus incompatible with these setup steps.

    $ cd ~/4diac-ide/
    $ git checkout develop

### 1.3 Import Plug-Ins into Workspace

1. change to the Git perspective within Eclipse

2. right click on the 4diac IDE git repository and select Import Projects…​ that opens a dialog. Select everything within this dialog except the following ones

3. Wait till Eclipse finished building the project (look at the progress bar at the right bottom corner of the Eclipse main window)

4. If you have a JRE > 21 installed, you need to make sure the compiler compliance level is set to JDK version 21 in order for the build to succeed. Go to Window → Preferences. Search for "Compiler" and in the "JDK Compliance" section, set "Compiler compliance level" to 21. If this step has not been completed properly the "Problems" view will be populated with "XText" errors.

5. Check problems view for errors. If you get API Baseline not set errors you need to perform the following steps:

   1. Open the Eclipse preferences: Window → Preferences

   2. Enter API in the top left search field. You should get three research results: 1. API Baselines, 2. API Errors/Warnings, and 3. API Use Scans

   3. You now have two options:

      1. Set an API Baseline for your developments:

         - Select: API Baseline

         - Click Add Baseline …​

         - Enter a name, e.g., MyEclipse

         - For the location select your Eclipse directory

         - Press Finish

         - Select your new baseline in the API Baselines window and press OK

      2. Set the API Baseline error to ignore:

         - Select: API Baseline

         - Set the option Missing API Baseline: which can be found in the bottom of the preferences window from Error to Ignore

Note | If you get an error in the "Problems" view stating "There is a possible API baseline mismatch …​", you can safely ignore this message. This message will not prevent the IDE from building successfully.

### 1.4 Set Target Platform

1. Expand the project `org.eclipse.fordiac.ide.product` and open the target configuration `org.eclipse.fordiac.ide.product.target`:

2. Wait until the target platform is resolved or press Reload and wait until it is resolved.

3. Press Set as Active Target Platform within the upper right corner and wait until the workspace is built.

4. To use 4diac IDE directly in development mode, you need to provide a type library and templates. These are located in the `data` directory of your cloned repository.

   1. Navigate to `org.eclipse.fordiac.ide/data/` in your file explorer and copy the `template` and `typelibrary` folders.

   2. Navigate to your active Eclipse workspace folder.

      Note

      The `.metadata` folder inside the workspace is hidden by default.

      - Windows: Enable "Hidden items" in the View menu of File Explorer.

      - macOS: Press `Command + Shift + .` to toggle hidden files.

      - Linux (Gnome): Press `Ctrl + H` to show hidden files.

   3. Paste the copied folders into the following directory: `.metadata/.plugins/org.eclipse.pde.core/.bundle_pool/`

### 1.5 Run in Development Mode

1. Open the `org.eclipse.fordiac.ide.product` file from the `org.eclipse.fordiac.ide.product` plug-in.

2. In the Testing section of the Overview tab, press Synchronize.

3. Press Launch an Eclipse Application in the Overview tab.

### Building your own 4diac IDE

A big drawback for running 4diac IDE from source is that you need at least 2 Eclipse instances running. Especially on systems with little memory this can be an issue. If you still want to keep up with the developments performed in the Git repository it makes sense to build a binary package. See Building a binary 4diac IDE package from source for details on how this can be achieved.

In addition we offer a nightly build of 4diac IDE here.

Go to top

## 2 Building a Binary 4diac IDE Package from Source

For building a binary 4diac IDE package from the source code the best is to use the Maven configuration which is also used to build 4diac IDE on our build server. A modern Eclipse IDE comes with Maven integration out of the box. Then the necessary steps for generating binary 4diac IDE packages are:

1. Have the 4diac IDE source code in an Eclipse workspace as described in Building and Running 4diac IDE from Source

2. Go to the root project `org.eclipse.fordiac.ide` and right-click on the pom.xml

3. Invoke the Run As → Maven Install.

4. After a successful build you will find the output in `plugins/org.eclipse.fordiac.ide.product/target/products` directory.

Alternatively you can run `mvn clean install` on the command line in the root folder of 4diac IDE source code.

Note | When running UI tests directly from an IDE (e.g. Eclipse) on macOS, you must manually add `-XstartOnFirstThread` to your JVM arguments. This is handled automatically by a Maven profile when building from the command line.

## Where to go from here?

Go back to Development Index

Go back to Eclipse 4diac Documentation page

Or Go to top