IntelliJ IDEA
1. Setup IntelliJ IDEA for OpenEMS Edge and Backend
-
Prepare Intellij IDEA
-
Download Java Development Kit (JDK) 11 and install it. We recommend the OpenJDK Temurin builds by the Adoptium project
-
We use the Amdatu Plugin. Please confirm that the plugin is compatible with the latest version. See the Amdatu homepage .
-
With the toolbox you can select the right version Intellij Version .
-
To avoid incompatible updates, you may disable Auto-Updates in the Toolbox. It is also possible to select a earlier version if the update was done accidentally
-
Search under Plugins "Amdatu" und "Checkstyle"
Figure 1. IntelliJ settingsFigure 2. Install plugins -
Preparing your project with intellij
Figure 3. IntelliJ project import from existing sourceFigure 4. Select directory to import -
Select Bnd/bndtools
Figure 5. Bnd import -
Build OpenEMS Edge in IntelliJ
Figure 6. build.gradle -
or alternatively make an configuration "edit configuration"
Figure 7. build gradle over configuration -
creating a new module
Figure 8. creating a modulRightclick on an existing module: New → Module
Amdatu→ Project Template Project (Stringtemplate)
-
add Support for Eclipse Code Formatting
Search for 'Adapter for Eclipse Code Formatter' in the Plugin store
Figure 9. download Adapter for Eclipse Code FormatterAfter restarting the IDE go to Settings → Other Settings → Adapter for Eclipse Code Formatter
Figure 10. Adapter SettingsCheck the radiobutton for "Use Eclipse’s Code Formatter"
Figure 11. Enable AdapterType in your Eclipse installation folder
Figure 12. Set Eclipse PathChoose 'Eclipse [built-in]' as a formatter config
Figure 13. Choose FormatNow Reformat Code will use the Eclipse format (e.g. Use TAB instead of Whitespaces)
-
2. Hints - intellij problems
-
If you have some problems - for example java version is not found: look in File → Project Structure → Project
Figure 14. check java version -
If there is the module not correctly loaded, you can see that the blue square is not present
Figure 15. not loaded modulesThis can be fixed via Tools → Amdatu → Refresh-Workspace. If it is still not working: File → Invalidate Caches/Restart