How to install STM32CubeProgrammer in Linux

I installed STM32CubeProgrammer in Ubuntu 18.04.3 LTS with the intention of solving an error that I get when attempting to flash micro controllers in my STM32WB55 Nucleo Pack, but STM32CubeProgrammer doesn't launch upon installation.

Nothing happens when I click on the icon in the launcher and I didn't find any executable files for launching the program. How can I proceed?


Solution 1:

The instructions in section 1.2.1 of the STM32CubeProgrammer software description worked for me.

I installed openjdk-8

sudo apt install openjdk-8-jre-headless

I set selected java-8 as my default run time engine

sudo update-alternatives --config java

and installed the following packages

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

Then I installed the STM32CubeProgrammer as I had done earlier

sudo ./SetupSTM32CubeProgrammer-2.2.1.linux

The last page of the installation procedure mentioned the path to the program files. The following path now leads to the program files on my system

/usr/local/STMicroelectronics/STM32Cube/STM32CubeProgrammer/

The program can be launched using

sudo /usr/local/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin/./STM32CubeProgrammer

Solution 2:

The other solutions mentioned here did not work for me on Ubuntu20.04.

According to a user on the ST forum (source), the JDK8 compatible version of openjfx is not available for Focal Fossa.

This StackOverflow question describes a simple and effective solution.

To get around this issue you can install an OpenJDK version that includes JavaFX.

I installed Liberica (making sure to select the full JDK) Running

sudo dpkg -i /path/to/bellsoft-jdk8u275+1-linux-amd64-full.deb

This installs the JDK and updates alternatives. (no need to run sudo update-alternatives --config java)

For me this was all I needed to do to get CubeProgrammer working