- Install git
- Building Preesm requires an active Internet connection, used to fetch Maven and/or Eclipse dependencies. This Internet connection is not required for running Preesm once built.
Note: if you need to work with Graphiti source code, please read these instructions first.
Tutorial created the 04.24.2012 by M. Pelcat
Updated the 27.02.2023 by H. Miomandre
- When building PREESM, you have to run a second Eclipse Application (the guest) within the Eclipse where the source code is imported (the host). This is explained below in the “Execution of Preesm” section;
- When using unreleased source code (that is any other commit different from the last tag), there could be some inconsistencies between released zip files (Preesm projects) used in tutorials and the Preesm tool itself;
Preesm requires the Eclipse environment, which runs on the Java platform. If you do not have Java yet, the Eclipse IDE will provide it. Otherwise, make sure the to have the version 17 Java*.
*Java 18 and 19 can be used to run and develop in Preesm, but may not be usable to run Maven commands for unit tests and product generation.
Eclipse is an extensible platform programmed in Java that allows developers to write their own IDE (Integrated Development Environment).
You can download and run the Eclipse installer here: https://www.eclipse.org/downloads/. During installation, please choose the “Eclipse IDE for RCP and RAP Developers” package to develop in Preesm. Install Eclipse in a folder where you have write access.
Run Eclipse by clicking on the eclipse file, you need to choose a workspace, i.e. a directory where the metadata of and/or your projects will be stored.
Install Development Requirements
- Go to “Help > Install New Software…”;
- In “Work with:”, choose the first Eclipse address:
2023-03 - https://download.eclipse.org/releases/2023-03/from the drop-down menu (at the time of writing).
- Look for Modeling > EMF - Eclipse Modeling Framework Xcore SDK (search for “xcore”) and Testing > RCPTT IDE (search for “rcptt”).
Click Next, accept the terms of the license agreement when asked. Wait for the end of installation.
No need to restart Eclispe when prompted.
- Go to “Help > Eclipse Marketplace…”;
- From the marketplace, install Eclipse Xtend (search for “xtend”), Eclipse Xtext (search for “xtext”), Checkstyle Plug-in, and the SonarLint Eclipse plug-in. You need to finish and reopen the marketplace for each solution.
- Restart Eclipse to complete the installation.
Import Preesm projects
You need to get the code from the git repository and import the projects into Eclipse. Our git repository is hosted by Github (see the Preesm team page on Github).
Clone the Preesm repository (git clone <url>, in the folder where you want to place your local repository):
git clone https://github.com/preesm/preesm.git(https)
git clone email@example.com:preesm/preesm.git(SSH)
Switch to the develop branch (git checkout develop) to get the latest developer version of our source.
Add the Preesm sources into Eclipse:
- Go to “File > Open Projects from File System…”
- In “Import source:” provide the path to the cloned git repository.
- Ensure the option “Search for nested projects” is checked.
- Select the following projects:
* There should be 23 selected projects.
- Click on Finish.
Compilation of Preesm
Close “Welcome” tab.
Eclipse should start the compilation right-away while the dependencies of Preesm as not yet been imported, resulting in compilation errors. While Preesm is being compiled, open the file
org.preesm.target-platform/org.preesm.target-platform.target and click ONCE on Set as Active Target Platform in the top right corner of the opening window to instruct Eclipse to fetch the dependencies required by Preesm. The only feedback provided by Eclipse is the small progress bar in the bottom right corner.
Click just once and have a coffee, even if nothing seems to happen. Eclipse will load the required dependencies and compile sources on its own.
If compilation errors remain, please check your Java version (see above), then try refreshing and cleaning projects with errors, and reloading the target platform.
Execution of Preesm
Right-click on the ‘org.preesm.ui’ plug-in, the click on Debug As > Eclipse Application.
An error window about
slf4j.simple may open, it can be safely ignored by clicking Continue.
A new Eclipse session is launched that behaves like the one obtained by Preesm users from the update site. The difference is that you can debug and modify code in the first Eclipse and test at the same time in the second Eclipse. You can see the tutorials to learn how to use the second Eclipse, import Preesm projects and test.
Building the Eclipse Product
This section describes how to build and export the Eclipse Product of PREESM, i.e. the standalone executable of PREESM (as folder structure or Zip archive).
This procedure is tested with Maven 3.8.8. Later versions are not supported. Maven is launched as
Note: Make sure your Eclipse either uses a different copy of the code or it is shutdown. Indeed the automatic builds of Eclipse can corrupt Maven build.
After installing Maven, run
mvn clean package -DskipTests from the root of the git repository. Maven compiles Preesm sources and builds the Preesm product.
When the build process has terminated successfully, the resulting products and archives will be located under
- I followed all steps but there are compilation errors
- (1) The build state of the Eclipse workspace can be corrupted after an update. To fix that, restart Eclipse then clean and rebuild your workspace.
- (2) Try reloading the target platform in
org.preesm.target-platform/org.preesm.target-platform.targetby clicking on Reload Target Platform.
- Missing artifact com.sun:tools:jar:1.8.0 is missing: This happens because Eclipse is running using a JRE instead of a JDK. Some Eclipse plugins needs Java packages that are not bundled with the JRE, but only with the JDK. If you installed the JDK, note that by default the JDK distribution for Windows also installs a JRE. Also, the installer adds a section in the PATH variable, that points to
C:\ProgramData\Oracle\Java\javapath, which is an alias to the JRE binaries. Please refer to this page for fixing the issue. Basically, it tells to prepend the PATH variable with the path to the JDK, while not removing the
- The Preesm runtime throws a popup error message on every interaction: Ensure that the version 17 of Java is used if you happen to have multiple installe at the same time.
My Eclipse interface behave weirdly, and double-clicking on an actor in PREESM does not open its refinement: This is due to interaction issues on Linux between Wayland and Eclipse-based application. Use X instead.
I still have issues setting up the Preesm developement environment: If you find one that can be reliably reproduced, please create an issue with the required informations.