24

I installed the Oracle Sql developer but I am not getting the startup page. A JavaFx error is encountered.

Problem Initializing JavaFx runtime

How can I solve this problem?

thatjeffsmith
  • 20,522
  • 6
  • 37
  • 120
Utkarsh
  • 546
  • 1
  • 5
  • 14

8 Answers8

27

Manual hack

If you don't care about the welcome page and just want to get rid of the error, you may be able to prevent the welcome page from showing on startup:

  1. Find the file containing the setting to show the welcome page on startup

    (Note: you may find multiple files if you've installed multiple versions of SQL Developer; typically you'll want to edit the file for the most recent version of SQL Developer as indicated by the version number in the system directory, e.g. system19.4.0.354.1759)

    • Linux/Mac

      find ~/.sqldeveloper/ -name dtcache.xml
      

      e.g.

      $ find ~/.sqldeveloper/ -name dtcache.xml
      /home/user/.sqldeveloper/system19.4.0.354.1759/o.ide.13.0.0.1.42.190403.1502/dtcache.xml
      
    • Windows

      Look for a file named dtcache.xml somewhere in C:\Users(your user)\AppData\SQL Developer\systemn.n.n.n.n.n\o.ide.n.n.n.n.n.n.n

  2. Open that file in your favourite editor

  3. Look for this line:

    <Key>oracle.help.StartPageEditor:TabCheckboxState:Default</Key>
    

    Just below that line, change the value from true to false

    e.g.

    <Value class="java.lang.Boolean">false</Value>
    

    If it doesn't exist, then you can simply add this to the end of the file just before </dt-cache>:

    <Item>
       <Key>oracle.help.StartPageEditor:TabCheckboxState:Default</Key>
       <Value class="java.lang.Boolean">false</Value>
    </Item>
    

Install JavaFX

If you want to properly fix this error, you'll need to install JavaFX. This is slightly complicated by the fact that only some Java distributions come bundled with JavaFX.

If you're using Ubuntu, see below. Otherwise:

  1. Find and install a distribution of Java that comes with JavaFX (make sure you install Java 11 or 8 as these are the versions supported by SQL Developer)

    • Using SDKMAN, install any distribution that includes fx in the name:

      $ sdk list java | egrep "8.0|11.0" | grep fx
                     |     | 11.0.10.fx   | zulu    |            | 11.0.10.fx-zulu     
                     |     | 8.0.282.fx   | zulu    |            | 8.0.282.fx-zulu     
                     |     | 11.0.10.fx   | librca  |            | 11.0.10.fx-librca   
                     |     | 8.0.282.fx   | librca  |            | 8.0.282.fx-librca
      

      e.g.

      sdk install 11.0.10.fx-zulu
      
    • Alternatively, you can install a Java distribution with JavaFX manually

  2. If SQL Developer can't find Java, you may need to manually point it to the Java you installed by setting SetJavaHome in product.conf

    This will vary by operating system and Java distribution

Full instructions for Ubuntu

Since this question was specifically asked for Ubuntu, here are the full steps for installing Oracle SQL Developer with JavaFX:

  1. Install alien, OpenJDK 11, and OpenJFX

    sudo apt install alien openjdk-11-jdk openjfx
    
  2. Download SQL Developer >= 19.2
    https://www.oracle.com/tools/downloads/sqldev-downloads.html

    • Download the Linux RPM
  3. Install SQL Developer

    sudo alien -i sqldeveloper-*.rpm
    
  4. (Optional) Create a desktop entry

    echo "[Desktop Entry]
    Type=Application
    Name=Oracle SQL Developer
    Exec=sqldeveloper
    Icon=/opt/sqldeveloper/icon.png
    Terminal=false" >> ~/.local/share/applications/sqldeveloper.desktop
    
  5. Open SQL developer in the terminal to set the path to the JDK

    $ /usr/local/bin/sqldeveloper 
    Type the full pathname of a JDK installation (or Ctrl-C to quit), the path will be stored in /home/user/.sqldeveloper/19.4.0/product.conf
    /usr/lib/jvm/java-11-openjdk-amd64/
    
bmaupin
  • 14,427
  • 5
  • 89
  • 94
  • Installing a specific version of openjfk, solved the issue for me and seems the most clean approach. Just to give this a highlight: You have to provide the explicit version for the `openjfx` **and** the `libopenjfx-*` packages. If you only provide the explicit version to the `openjfx` package, the too new versions of the `libopenjfx-*` packages will be installed Thank you bmaupin – kajk Jul 16 '19 at 14:47
  • Thank you, this helped in Ubuntu 18.04 for JDK 8. I know that JavaFX was needed just to display the main window, so I could skip it -> but now it just works perfectly – rodikno Mar 30 '20 at 11:59
  • In my environment, that key didn't exist in dtcache.xml. However, I added `oracle.help.StartPageEditor:TabCheckboxState:Defaultfalse` before the last ``, it was applied. – YujiSoftware Apr 09 '21 at 08:45
  • @YujiSoftware thanks! I just updated the answer with your suggestion – bmaupin Apr 09 '21 at 13:05
  • Confirmed on Mac OS - the only thing I'll add is that I have multiple dtcache.xml files from older versions of SQL Developer. I just made sure to edit the most recent file, shown by: `find ~/.sqldeveloper/ -name dtcache.xml -ls` – SteveT May 04 '21 at 13:48
  • @SteveT I added a note about this, thanks! – bmaupin May 04 '21 at 15:04
9

The message indicates your Java Home needs the JavaFX engine/feature/jars for this page to work.

We have several pages that use Java FX to render visualizations - the Welcome Page, Instance Viewer, and Real Time SQL Monitoring are the big ones.

Make sure you have running Oracle Java 8 JDK. I'm guessing you're running Open JDK - which we technically don't support, but it probably will work.

Note: as an Oracle product requiring Java, you are allowed to use the Oracle JDK (v8 today or v11 when we introduce support later this Summer) at no additional cost.

Or go get the jar(s) and add them to your Java Home.

Brandon Essler
  • 710
  • 8
  • 21
thatjeffsmith
  • 20,522
  • 6
  • 37
  • 120
6

If you're using OpenJDK there's no need to switch to Oracle JDK (or shoe-horn Oracle's Java FX jars into your OpenJDK installation as has been suggested above); Java FX is now part of OpenJDK but needs to be installed separately:

sudo apt-get install openjfx
David Easley
  • 1,347
  • 1
  • 16
  • 24
5

Summary of a solution for Mac OS (Catalina) and SQL Developer 19.4:

  1. Check installed java versions on Mac: ls /Library/Java/JavaVirtualMachines/
  2. Ensure you have 8 or 11 java version installed, must be official java from Oracle - openjdk doesn't include JavaFX
  3. Check the correct path for e.g. version 11, run this command in terminal: /usr/libexec/java_home -F -v 11
  4. Copy the path, e.g. /Library/Java/JavaVirtualMachines/jdk11.0.6.jdk/Contents/Home
  5. Edit in user home dir the file ~/.sqldeveloper/19.4.0/product.conf : SetJavaHome /Library/Java/JavaVirtualMachines/jdk-11.0.6.jdk/Contents/Home

This worked for me.

arno77
  • 59
  • 1
  • 3
2

I know this is a Linux thread, but I had the same issue on windows.

bmaupin pointed to the right correction.

My setup is that I use OpenJDK and have that set as JAVA_PATH. But if you download the correct version of Oracle SQL Developer, it brings its own Java SDK. All that needs to be done, is point to it.

  1. Search for: C:\Users\Name\AppData\Roaming\sqldeveloper\19.4.0\product.conf
  2. Edit that file: Change the path to the JDK coming with SQL Developer:

_

# SetJavaHome C:\Program Files\OpenJDK8
SetJavaHome C:\Program Files\sqldeveloper\jdk

Done.

Gunnar Bernstein
  • 6,074
  • 2
  • 45
  • 67
0

Just FYI, seems the JDK installed with 18.4 XE does not include JavaFX.

[oracle@localhost ~]$ which java
/opt/oracle/product/18c/dbhomeXE/jdk/bin/java
[oracle@localhost ~]$ java -version
java version "1.8.0_171"
Java(TM) SE Runtime Environment (build 1.8.0_171-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)

enter image description here

0

For those that get recent upgrade to java 11 as default jre and get an application that don't work with it (still need java 8) I just find that you still can downgrade openjfx (that's works for SQL Developper in my case)

sudo apt install libopenjfx-java=8u161-b12-1ubuntu2
sudo apt install libopenjfx-jni=8u161-b12-1ubuntu2
sudo apt install openjfx=8u161-b12-1ubuntu2

Then. check that you have the OpenJFX 8 :

$ dpkg -l | grep openjfx

ii  libopenjfx-java    8u161-b12-1ubuntu2   all          JavaFX/OpenJFX 8 - Rich client application platform for Java (Java libraries)
ii  libopenjfx-jni     8u161-b12-1ubuntu2   amd64        JavaFX/OpenJFX 8 - Rich client application platform for Java (native libraries)
ii  openjfx            8u161-b12-1ubuntu2   amd64        JavaFX/OpenJFX 8 - Rich client application platform for Java

I hope that helps !

tr4ck3ur
  • 9
  • 1
  • You can install all of these using the same command (`sudo apt install libopenjfx-java=8u161-b12-1ubuntu2 libopenjfx-jni=8u161-b12-1ubuntu2 openjfx=8u161-b12-1ubuntu2`). However, the biggest problem with this solution is that the packages will be upgraded the next time you install system updates unless you hold these packages ([How to prevent updating of a specific package?](https://askubuntu.com/a/18656/18665)) – bmaupin Jun 06 '19 at 19:24
0

Well, i had to install Oracle's Java 8 SDK manually. And SQLDeveloper executes without errors

Since i have Ubuntu installed, i went to Oracle SQL Developer download page and downloaded Other Platforms. Notice right under it has a link to the lastest Oracle 8 JDK (211) next to Installation Notes.

You can follow here, but this is for a full install of Oracle's Java 8 JDK and i want only SQL Developer pointing to it. In sudo update-alternatives --config java i still have openjdk installed with no problems.

So in /usr/lib/jvm:

sudo tar -xvzf ~/Downloads/jdk-8u211-linux-x64.tar.gz

Inform Ubuntu of installed location:

sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.8.0_211/bin/java" 0
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.8.0_211/bin/javac" 0

Check with sudo update-alternatives --config java

In local folder or user directory that executed sqldeveloper.sh:

nano/vi/vim/emacs /home/user/.sqldeveloper/19.1.0/product.conf

update the line SetJavaHome /usr/lib/jvm/someOpenJDKInstallation to SetJavaHome /usr/lib/jvm/jdk1.8.0_211/

Or if running for a first time, answer this directory /usr/lib/jvm/jdk1.8.0_211/ when it asks for a JDK.

Hinotori
  • 552
  • 6
  • 15