Develop in IDEA
Table of contents
Overview
DBeaver is built on the Eclipse Platform, making the Eclipse IDE a logical choice for its development. However, many developers prefer the IntelliJ IDEA.
In this guide, we aim to demonstrate how to open the DBeaver project in IDEA, write and compile code, and, most importantly, run and debug the application, leveraging the excellent Java debugger available in IDEA.
Instructions
Opening the project and understanding its module structure in IDEA is relatively straightforward. The complexity arises when attempting to run or debug the project, as this process requires an Eclipse runtime workspace, a feature exclusive to the Eclipse IDE that IntelliJ IDEA does not support.
Opening DBeaver in IDEA
- Create a folder where you will clone DBeaver repositories.
Note: all repositories must be located in the same folder. For example, name it
dbeaver-ce
. - Navigate to the created folder using the command:
cd dbeaver-ce
. - Clone the DBeaver repository with:
git clone https://github.com/dbeaver/dbeaver.git
. - Clone the IDEA generator with:
git clone https://github.com/dbeaver/idea-rcp-launch-config-generator.git
. - Clone the common components with:
git clone https://github.com/dbeaver/dbeaver-common.git
.Tip: Optionally, for documentation purposes, clone the WIKI repository with:
git clone https://github.com/dbeaver/dbeaver.wiki.git
(skip this step if you do not need the WIKI). - Execute the
generate_workspace
script in either the dbeaver or CloudBeaver repo, depending on the workspace you need. Once dependencies are downloaded and IDEA configs created, the folderdbeaver-workspace
will appear. The IDEA configuration, by default, will be generated indbeaver-workspace/dbeaver-ce
ordbeaver-workspace/dbeaver/cloudbeaver-ce
, which can be opened in IntelliJ IDEA. - Launch IDEA and open the idea project in the folder. it should contain all launch configurations
- Before compiling, you will need to build parser grammar files. To do this, locate
org.jkiss.dbeaver.model.lsm
in your Project. Right-click on the module and select Open In -> Terminal. Then, executemvn clean install
in the terminal. - For DBeaver, everything is set up and ready. Hit CTRL+F9 and wait. CloudBeaver requires the additional steps below to launch properly
Additional steps for Cloudbeaver
- To launch CloudBeaver, we first need to execute the
build.sh
orbuild.bat
script incloudbeaver/deploy
. After the script execution
cloudbeaver
folder will appear. Create theopt
folder in the root directory and copy it there.
Troubleshooting
If you encounter problems, do not hesitate to double-check your configuration and try again. If you're still experiencing issues, feel free to ask for help at tickets.