Develop in IDEA
Develop and debug DBeaver in IntelliJ IDEA
Well, this a tricky part.
DBeaver is based on Eclipse Platform and it seems logical to develop it in Eclipse IDE.
However, many people find that even the latest Eclipse Java IDE is not as good and convenient as IntelliJ IDEA.
I personally also prefer to develop in IDEA - mostly because of past experience but also because of many really helpful features in it.
Anyhow, here we will try to open the DBeaver project in IDEA, write code, compile code, run and eventually debug (as Java debugger really rocks in IDEA).
It is quite easy to open the project, see the module structure and even compile.
But running/debugging is the trickiest part because it requires Eclipse runtime workspace and only Eclipse IDE can create one (IDEA does not support this and nobody can blame JetBrains for that).
So, we will still need Eclipse to configure the workspace for the debugger. But once you do this, you will no longer need to run Eclipse (until the plugins structure or versions change).
Opening DBeaver in IDEA
- Create some folder where you will clone DBeaver repositories. Note: all repositories must be located in the same folder. For example
git clone https://github.com/dbeaver/dbeaver.git
git clone https://github.com/dbeaver/dbeaver-idea-project.git
git clone https://github.com/dbeaver/dbeaver.wiki.git(skip it if you do not need WIKI)
- Start IDEA->Open. select folder
- Now you can see the DBeaver modules structure:
- You can edit the code but you cannot compile it because there are no Eclipse dependencies configured.
Prepare Eclipse IDE and workspace
- Perform all steps described in the Develop in Eclipse article. Use just cloned
dbeaver-ce/dbeaveras the sources root.
- Eventually you should be able to compile and run DBeaver from Eclipse
- Remember where your Eclipse IDE is located (let's say
Configuring dependencies and compile the application
- Now we need to add Eclipse dependencies in the IDEA project configuration.
- Make sure you have the proper project Java SDK configured (Java 11+)
- Go to
- Create new library
ECLIPSE(name and case are important)
- Click the "Add" button. Select the folder
- Recent IDEA should add all Eclipse jars as dependencies. But in some IDEA versions you will also need to add some other folders manually:
- If that is not enough, add all folders in
eclipse-ide-path/plugins/org.jkiss*. Then manually download and add Mockito and JUnit.
- Eventually you will see something like this:
- Now you should be able to compile the project. Just hit CTRL+F9 and wait.
Running and debugging
DBeaver is an Eclipse RCP and must be started using the Eclipse Equinox Launcher bundle. This is a special jar file which resides in the Eclipse plugins folder and we need to add it to dependencies directly in order to be able to debug.
- Add the launcher config as a jar dependency for module
dbeaver. Locate the jar
eclipse-ide-path/plugins/folder. Like this:
- Open debug configuration "Debug DBeaver Community" and change the path in the parameters
Replace the path before
.metadatawith path to your Eclipse workspace. Eventually it should look like this:
- Click ok and run the debugger. DBeaver must start. Now you can enjoy debugging in IDEA :)
Most likely something will go wrong as these instructions are quite long. Do not be afraid to recheck the configuration and try again. If nothing helps - do not hesitate to ask at tickets.