cancel
Showing results for 
Search instead for 
Did you mean: 

I am not able to start STM32CubeProgrammer even installed Oracle JDK 13.0.1 and openjfx. What's the problem?

JasonZ
Associate II

I am not able to start STM32CubeProgrammer even installed Oracle JDK 13.0.1 and openjfx:

System: Ubuntu 18.04 VirtualBox on MacOS 10.15: 

~$ STM32CubeProgrammer

Error: Could not find or load main class com.st.app.Main

Caused by: java.lang.NoClassDefFoundError: javafx/application/Application

~$ java --version

java 13.0.1 2019-10-15

Java(TM) SE Runtime Environment (build 13.0.1+9)

Java HotSpot(TM) 64-Bit Server VM (build 13.0.1+9, mixed mode, sharing)

8 REPLIES 8
Aymen Abderrahmen_
Associate II

​Hi Jason,

Here is the procedure to get CubeProgrammer working with ubuntu18.04

1- Install OpenJDK 8 :

=> sudo apt install openjdk-8-jre-headless

2- Set OpenJDK 8 as your default Java Runtime Engine :

=> sudo update-alternatives --config java

3- Install OpenJFX

=> 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

and finally don't forget to create stlink and DFU usb rules (described in user manual) to get STM32CubeProgrammer working without "sudo".

BR,

Aymen.

The rules files are in /etc/udev/rules.d but still see the STLINK V3 got lost somehow:

Ubuntu18:/etc/udev/rules.d$ ls -l 

total 140

-rw-r--r-- 1 root root  619 Oct 24 13:39 49-stlinkv2-1.rules

-rw-r--r-- 1 root root  491 Oct 24 13:39 49-stlinkv2.rules

-rw-r--r-- 1 root root  883 Oct 24 13:39 49-stlinkv3.rules

-rw-r--r-- 1 root root  97 Oct 22 12:10 50-usb-conf.rules

-rw-r--r-- 1 root root  381 Sep 21 11:07 61-msp430uif.rules

-rwxr-xr-x 1 root root 2145 Sep 21 11:07 70-mm-no-ti-emulators.rules

-rw-r--r-- 1 root root 58549 Sep 20 17:18 70-snap.core.rules

-rw-r--r-- 1 root root  705 Oct 14 13:26 70-snap.prospect-mail.rules

-rw-r--r-- 1 root root  669 Oct 14 08:36 70-snap.thunderbird.rules

-rw-r--r-- 1 root root  691 Sep 21 11:05 71-bh-permissions.rules

-rw-r--r-- 1 root root  559 Sep 21 11:06 71-sd-permissions.rules

-rw-r--r-- 1 root root 1814 Sep 21 11:06 71-ti-permissions.rules

-rw-rw-r-- 1 root root 18450 Oct 14 05:03 99-jlink.rules

-rw-r--r-- 1 root root 4286 Sep 21 11:12 99-jlink.rules.O

-rw-r--r-- 1 root root  217 Oct 22 12:10 Readme.txt

-rw-r--r-- 1 root root   5 Oct 22 12:10 version.txt

Ubuntu18:/etc/udev/rules.d$ STM32_Programmer_CLI -l

   -------------------------------------------------------------------

            STM32CubeProgrammer v2.2.0          

   -------------------------------------------------------------------

 

===== DFU Interface  =====

 

No STM32 device in DFU mode connected

 

===== STLink Interface =====

 

-------- Connected ST-LINK Probes List --------

 

ST-Link Probe 0 :

  ST-LINK SN : 002200293137510739383538

  ST-LINK FW : V3J3M2

-----------------------------------------------

 

===== UART Interface =====

 

Total number of serial ports available: 1

 

Port: ttyACM0

Location: /dev/ttyACM0

Description: STLINK-V3

Manufacturer: STMicroelectronics

 

Ubuntu18:/etc/udev/rules.d$ STM32_Programmer_CLI -l

   -------------------------------------------------------------------

            STM32CubeProgrammer v2.2.0          

   -------------------------------------------------------------------

 

===== DFU Interface  =====

 

No STM32 device in DFU mode connected

 

===== STLink Interface =====

Error: No ST-Link detected!

 

===== UART Interface =====

 

Total number of serial ports available: 0

I confirm this is the only valid procedure to run STM32CubeProgrammer on Ubuntu 18.04

Here is the procedure to get CubeProgrammer working with ubuntu18.04
 
 
 
1- Install OpenJDK 8 :
 
=> sudo apt install openjdk-8-jre-headless
 
2- Set OpenJDK 8 as your default Java Runtime Engine :
 
=> sudo update-alternatives --config java
 
3- Install OpenJFX
 
=> 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

SebCanet
Associate II

Hi,

I follow exactly what you wrote but about line 17, I get:

version 8u161-b12-1ubuntu2 for openjfx was not find

Any idea ???

Ubuntu 18.04 is now pretty old and a new LTS release is available.

Any chance of making it work with OpenJDK 11?

These openjfx versions are not available on 19.10 and 20.04...

Confirms it works. I don't know much about ubuntu but typed it and Voilà! Thanks!

Agreed, I can't get this to work with Ubuntu 20.04

I can run the CLI application and connect to the STLINKv3 and see the microcontroller but can't install jfx of hte specified versions

I was able to get it to work on Ubuntu 20.04.1 LTS using the Liberica JDK. But I havent thoroughly tested it.

I followed the instructions here to install it: https://stackoverflow.com/a/62746011/848627

You may need to uninstall other openjfx stuff you have installed previously, not sure.

edit: It did managed to do a ST-Link firmware upgrade, and a flash in USB mode (not st-link mode), so presumably it all works as expected.