25

Is there a way of pointing to the proper Java/JRE in dbeaver.ini?

This works:

dbeaver.exe -vm "C:\Program Files\Java\jre1.8.0_131\bin\server"

...but this way I can't pin DBeaver to taskbar (its icon gets duplicated)

Is there a way of achieving the above within the ini file? Or does the JRE need to be determined before dbeaver.ini file is read?

(I would like to stick to DBeaver without installing its bundled JRE.)

These are -vm args I tested as #1 line of dbeaver.ini:

-vm "C:\Program Files\Java\jre1.8.0_131\bin"
-vm "C:\Program Files\Java\jre1.8.0_131\bin\javaw.exe"
-vm "C:\Program Files\Java\jre1.8.0_131\bin\server"
-vm "C:\Program Files\Java\jre1.8.0_131\bin\server\jvm.dll"
Jaroslav Záruba
  • 1,098
  • 5
  • 17
  • 27

6 Answers6

31

Edit:

Specify the -vm argument after the -startup and -launcher.library arguments but before -vmargs. Additionally the path to the JRE should be on the line after -vm without the path quoted, e.g.

-startup
plugins/org.eclipse.equinox.launcher_1.3.201.v20161025-1711.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.401.v20161122-1740
-showsplash
-vm 
C:\Program Files\Java\jre1.8.0_121\bin\server\jvm.dll
-vmargs
-Xms64m
-Xmx1024m

How did you install DBeaver? From the downloads page:

If you already have JRE installed on your computer you may disable JRE option in installer. However it is recommended to use JRE shipped with DBeaver (it won’t be break any existing JRE installation, nothing will be copied in system folders, registry or environment variables).

Did you disable the JRE option when installing?

Kyle
  • 426
  • 4
  • 4
  • Yes sir, I have disabled/unchecked installation of DBeaver's JRE. And I would like to point DBeaver to one of the JREs I have on my machine. – Jaroslav Záruba Jun 15 '17 at 12:05
  • 1
    @JaroslavZáruba Have you added -vm "C:\Program Files\Java\jre1.8.0_131\bin\server\javaw.exe" to your dbeaver.ini BEFORE -vmargs? – Kyle Jun 15 '17 at 13:08
  • javaw.exe is not under server\ (checked all JDKs/JREs under C:\Program Files\Java\)... but I have updated the question with list of -vm I tested – Jaroslav Záruba Jun 16 '17 at 07:53
  • Regardless of what I put into the -vm arg I see following on the 3rd line of the error report: "java.version=1.7.0_55" – Jaroslav Záruba Jun 16 '17 at 08:13
  • And even when I set JAVA_HOME to 1.8, DBeaver still insists java version is 1.7.0_55 – Jaroslav Záruba Jun 16 '17 at 08:15
  • 1
    @JaroslavZáruba, I've updated my answer to show an example .ini. I tested with a fresh install of DBeaver on Win 7 without JRE and pointed it to an existing JRE with success this way. – Kyle Jun 16 '17 at 14:04
  • awesomeness! so i was adding the argument using wrong syntax... thank you sir! – Jaroslav Záruba Jun 16 '17 at 19:24
  • it still doesnt work for me, somehow the system takes a new path (new for me) pointing to program files/common files/oracle/java/javapath etc.. wondering if thats the true jre on my system.. havent seen that before – Raghav Nov 27 '20 at 14:46
  • It is strange that docu mentions: ` -vm ` but it doesn't work if `-vm` and `java vm path` are placed at the same line. Placing them on different lines in dbeaver.ini works, but how to do the same thing in terminal, that's the question... – ka3ak Sep 08 '21 at 08:33
8

This is my solution for Linux users. Dbeaver configuration file is located in the following folder:

/usr/share/dbeaver/dbeaver.ini

Edit dbeaver.ini by adding these lines at the top of the file:

--launcher.appendVmargs
-vm
/home/xxx/java/jdk1.8.0_221/jre/bin
ZygD
  • 2,459
  • 12
  • 26
  • 43
nix
  • 181
  • 1
  • 3
7

For Arch/Manjaro users ...

sudo pacman -S jre-openjdk
archlinux-java status

The answer could be something like ...

Available Java environments:
  java-15-openjdk
  java-8-openjdk (default) 

Then you need to change the default environment with:

sudo archlinux-java set java-15-openjdk

That's it!

Joe Louis
  • 71
  • 1
  • 1
1

Running Windows 10, all I did was open up the dbeaver.ini file in the install directory and write these couple of lines on top of everything.

-vm
C:\PathToJDKInstallationDirectory\Java\jdk-11\bin\server\jvm.dll

So now the file looks like this:

-vm
C:\Program Files\Java\jdk-11\bin\server\jvm.dll
-vmargs
-XX:+IgnoreUnrecognizedVMOptions
--add-modules=ALL-SYSTEM
--add-opens=java.base/java.nio=ALL-UNNAMED
--add-opens=java.base/java.net=ALL-UNNAMED
-Dosgi.requiredJavaVersion=11
-Xms64m
-Xmx1024m
-Ddbeaver.distribution.type=exe

Hit save and DBeaver is now working properly.

  • 1
    Nice to have a Win answer as well :-) It would be improved by showing the entire content of the `.ini` file instead of these two lines, as someone with isn't familiar with this file (take me, for example) wouldn't be able to do this correctly. You can just [edit](https://superuser.com/posts/1775472/edit) the answer and add it there. – Peregrino69 Mar 24 '23 at 14:38
  • Works great with current last version (23.1.5). Thanks! – Camille Aug 22 '23 at 07:42
0

On macOS, I was able to check the location of my JDK with this:

$ /usr/libexec/java_home -F

Then I could use that value to replace the -vm value in dbeaver.ini, which is within DBeaver.app:

$ nano /Applications/DBeaver.app/Contents/Eclipse/dbeaver.ini 
James Irwin
  • 101
  • 2
-1

I pinned the icon to the taskbar and then added the -vm parameter changing the properties of the icon. The icon got duplicated. I removed the first one and pinned and renamed the second.

  • Hello, I fail to understand how this is any related to the question, apart from the `-vm` parameter. Could you explain? – Destroy666 May 02 '23 at 21:08