I'm trying to install and run the STM32CubeProgrammer app (a .linux file) on Ubuntu. When I first ran it, I got this professional-looking error:

enter image description here

I spent hours trying a lot of stuff, including installing OpenJFX, OpenJDK-8 etc. Nothing worked. Now, I've just done my best to purge OpenJDK entirely and installed Oracle Java 11.02 (which should contain this Java FX, I assume?). java -version gives:

java version "11.0.2" 2019-01-15 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.2+9-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.2+9-LTS, mixed mode)

JAVA_HOME has been set and JAVA_HOME/bin added to PATH. There are no other java-alternatives present, as far as I know. I've also redirected the default-java symlink to point to the new Oracle path. And yet, I still get this error. I've already tried deleting the STM32Programmer installation folder and re-installing just in case; its official uninstaller.jar also doesn't work apparently.

  • So, assuming the app is still sane and there's really still some lingering OpenJDK artifacts causing this error, where would they be? Is there any place else I should check to completely remove OpenJDK?
  • The error says to download Oracle JRE but there's no explicit JRE folder in my installation, even if java and javac still work. Does this matter?
  • The STM32 .linux app seemed to install in a single folder in my home directory. Since the uninstaller doesn't work (it just spits out some log data), I deleted the installation folder instead. Are there other folders to check in cases like this, to ensure everything got purged?

I'm using Ubuntu 19.04.

  • What does this output? apt list --installed | grep -e jdk -e jre – You'reAGitForNotUsingGit Jun 22 '19 at 16:37
  • @AndroidDev I get this: default-jdk-headless/disco,now 2:1.11-71 amd64 [installed,automatic] default-jdk/disco,now 2:1.11-71 amd64 [installed] default-jre-headless/disco,now 2:1.11-71 amd64 [installed,automatic] default-jre/disco,now 2:1.11-71 amd64 [installed] – SoreDakeNoKoto Jun 22 '19 at 17:05
  • Ahhh... yeah so you have default-jdk installed, which is openjdk. Go ahead and do sudo apt purge default-jdk default-jre – You'reAGitForNotUsingGit Jun 22 '19 at 21:47
  • @AndroidDev I haven't tried that yet but it turns out the STM32 app is at fault checking for a non-existent folder (something like JAVA_HOME/jre/lib/javafx.properties) and then throwing the same error if it can't find it. I found this in a script inside its package. Both Oracle and OpenJDK no longer ship the jre folder or JavaFX by default, so the check always fails. So the problem isn't OpenJDK remnants, just a stupid deceptive error message thrown by the app. I eventually gave up on it and just went with the open-source stm32flash CLI app. – SoreDakeNoKoto Jun 23 '19 at 9:10

Gents, I'd spent hours researching the selfsame issue with the STM32CubeProgrammer, so thanks for taking this most of the way. I came to this late and having assumed that my installation of Ubuntu would, by default, provide all the required ingredients. In any case, I've gone ahead and purged the java that I had installed under my faulty assumptions.

Step 1 java -version produced the following:

openjdk version "11.0.6" 2020-01-14 OpenJDK Runtime Environment (build 11.0.6+10-post-Ubuntu-1ubuntu118.04.1) OpenJDK 64-Bit Server VM (build 11.0.6+10-post-Ubuntu-1ubuntu118.04.1, mixed mode, sharing)

Step 2 sudo apt-get purge openjdk* produced:

Reading package lists... Done Building dependency tree
Reading state information... Done Note, selecting 'openjdk-9-jre-headless' for glob 'openjdk*' ... and so on

Step 3 sudo apt-get install oracle-java8-installer produced:

Reading package lists... Done Building dependency tree
Reading state information... Done Package oracle-java8-installer is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package 'oracle-java8-installer' has no installation candidate ... Ok, just another setback most of you would have anticipated!

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

Reading package lists... Done Building dependency tree
Reading state information... Done libopenjfx-java is already the newest version (8u161-b12-1ubuntu2). libopenjfx-java set to manually installed. libopenjfx-jni is already the newest version (8u161-b12-1ubuntu2). libopenjfx-jni set to manually installed. The following packages were automatically installed and are no longer required: efibootmgr libfwup1 libwayland-egl1-mesa openjfx-source Use 'sudo apt autoremove' to remove them. The following additional packages will be installed: ca-certificates-java openjdk-8-jre openjdk-8-jre-headless Suggested packages: icedtea-8-plugin fonts-ipafont-gothic fonts-ipafont-mincho fonts-wqy-microhei fonts-wqy-zenhei The following NEW packages will be installed: ca-certificates-java openjdk-8-jre openjdk-8-jre-headless The following packages will be DOWNGRADED: openjfx 0 upgraded, 3 newly installed, 1 downgraded, 0 to remove and 3 not upgraded. Need to get 27.6 MB of archives. After this operation, 101 MB of additional disk space will be used. Do you want to continue? [Y/n] y Get:1 http://us.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 openjdk-8-jre-headless amd64 8u242-b08-0ubuntu3~18.04 [27.5 MB] Get:2 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 ca-certificates-java all 20180516ubuntu1~18.04.1 [12.2 kB] Get:3 http://us.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 openjdk-8-jre amd64 8u242-b08-0ubuntu3~18.04 [69.7 kB] Get:4 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 openjfx amd64 8u161-b12-1ubuntu2 [33.6 kB] Fetched 27.6 MB in 5min 59s (76.7 kB/s)
Selecting previously unselected package openjdk-8-jre-headless:amd64. (Reading database ... 164080 files and directories currently installed.) Preparing to unpack .../openjdk-8-jre-headless_8u242-b08-0ubuntu3~18.04_amd64.deb ... Unpacking openjdk-8-jre-headless:amd64 (8u242-b08-0ubuntu3~18.04) … ...

Step 5 Hold the package: as per post by Ehsan in a related thread

sudo apt-mark hold openjfx libopenjfx-java libopenjfx-jni

Step 6 ls -l of the STM32 install directory /usr/local/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin total 17220 drwxr-xr-x 6 root root 4096 Apr 2 04:47 ExternalLoader drwxr-xr-x 2 root root 4096 Apr 2 04:47 FlashLoader drwxr-xr-x 3 root root 4096 Apr 2 04:47 HSM -rw-r--r-- 1 root root 2715616 Feb 20 17:35 libcrypto.so -rw-r--r-- 1 root root 548696 Feb 20 17:35 libssl.so -rw-r--r-- 1 root root 382309 Sep 11 2019 libstp11_SAM.so -rw-r--r-- 1 root root 354 Apr 2 04:47 libstp11_SAM.so.conf drwxr-xr-x 2 root root 4096 Apr 2 04:47 PersoPackages drwxr-xr-x 2 root root 4096 Apr 2 04:47 platforms drwxr-xr-x 3 root root 4096 Apr 2 04:47 RSSe -rwxr-xr-x 1 root root 163 Dec 9 23:30 STM32CubeProgrammer -rwxr-xr-x 1 root root 7727803 Feb 20 17:44 STM32CubeProgrammerLauncher -rwxr-xr-x 1 root root 1645912 Feb 20 17:35 STM32MP_KeyGen_CLI -rwxr-xr-x 1 root root 1673192 Feb 20 17:35 STM32MP_SigningTool_CLI -rwxr-xr-x 1 root root 1808746 Feb 20 17:42 STM32_Programmer_CLI -rwxr-xr-x 1 root root 147 Apr 18 2018 STM32_Programmer.sh -rwxr-xr-x 1 root root 803594 Feb 20 17:42 STM32TrustedPackageCreator -rwxr-xr-x 1 root root 277313 Feb 20 17:42 STM32TrustedPackageCreator_CLI

Step 7 launch of the Cube Programmer shell

                    STM32CubeProgrammer v2.4.0                  

Usage : STM32_Programmer_CLI.exe [command_1] [Arguments_1][[command_2] [Arguments_2]...]

Generic commands:

-?, -h, --help : Show this help

Step 8 launch of the Cube Programmer from the terminal produced a lot of messages as follows:

/usr/local/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin$ ./STM32CubeProgrammer Gtk-Message: 12:37:27.325: Failed to load module "canberra-gtk-module" No properties file found java.io.FileNotFoundException: /home/carlos/.STM32CubeProgrammer/config.properties (No such file or directory) at java.io.FileInputStream.open0(Native Method) at java.io.FileInputStream.open(FileInputStream.java:195) at java.io.FileInputStream.(FileInputStream.java:138) ... but it did launch, also screen shot of Cube Programmer as tested from the desktop and connected to the "blue pill" via serial

Hope this helps! Rgds, C

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.