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?
4 Answers
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-headlessI set selected java-8 as my default run time engine
sudo update-alternatives --config javaand 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-javaThen I installed the STM32CubeProgrammer as I had done earlier
sudo ./SetupSTM32CubeProgrammer-2.2.1.linuxThe 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 7 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.debThis 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
I've got this working on Ubuntu 20.04 + openjdk 11.0.10
If you run STM32CubeProgrammer from cli you'll get a clue to the problem
./STM32CubeProgrammer
Error: Could not find or load main class com.st.app.Main
Caused by: java.lang.NoClassDefFoundError: javafx/application/ApplicationSo, annoyingly javafx is no longer packaged with java 9+
So the fix is to either find an older java or:
- Download javafx and unpack to a folder
- Update STM32CubeProgrammer script vi $(which STM32CubeProgrammer)
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
export LD_LIBRARY_PATH=$DIR/../lib:$LD_LIBRARY_PATH
export PATH_TO_FX=/home/williao/tools/javafx-sdk-11.0.2/lib
java --module-path $PATH_TO_FX:$PATH_TO_FX/lib --add-modules javafx.controls,javafx.fxml,javafx.web -jar $DIR/STM32CubeProgrammerLauncherDon't forget to change PATH_TO_FX!!!!
I found this site while looking for how to fix the installer in Debian. This worked for me.
$ sudo java -jar SetupSTM32CubeProgrammer-2.8.0.exe