Skip to main content
Cedric Boudinet
Associate III
January 11, 2018
Solved

Can not start STM32CubeProgrammer under Debian

  • January 11, 2018
  • 23 replies
  • 8188 views
Posted on January 11, 2018 at 11:54

Under Linux Debian Stretch:

- if I use the shortcut nothing happens

- if I type ./STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin/STM32CubeProgrammerLauncher,

I have this error message: Error: Could not find or load main class com.st.app.Main

What should I do in order to run Cube Programmer ?

Regards

Cedric

    This topic has been closed for replies.
    Best answer by Aymen Abderrahmen
    Posted on January 12, 2018 at 02:37

    Hi Cédric,

    You are surely using OpenJDK, which is unsupported. Please install oracle Java or install Openjfx package (sudo apt-get install openjfx).

    BR,  

    Aymen.

    23 replies

    AvaTar
    Senior III
    January 11, 2018
    Posted on January 11, 2018 at 12:08

    I would guess it is not properly installed.

    Most installations under Unix/Linux require root priviledges, usually realized via

    sudo

    .
    Cedric Boudinet
    Associate III
    January 11, 2018
    Posted on January 11, 2018 at 16:36

    I reinstalled it with sudo, but I still have the same error message:

    /usr/local/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin/STM32CubeProgrammerLauncher

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

    AvaTar
    Senior III
    January 11, 2018
    Posted on January 11, 2018 at 18:31

    This was just an idea, I don't use this tool.

    The announcement thread was flooded by a large amount of complaints and bug reports - I guess the test on Linux where flimsy as usual (to say the least...).

    Aymen Abderrahmen
    Visitor II
    January 12, 2018
    Posted on January 12, 2018 at 02:37

    Hi Cédric,

    You are surely using OpenJDK, which is unsupported. Please install oracle Java or install Openjfx package (sudo apt-get install openjfx).

    BR,  

    Aymen.

    Cedric Boudinet
    Associate III
    January 12, 2018
    Posted on January 12, 2018 at 09:41

    It works after installing openjfx

    Thanks a lot

    Bests

    AvaTar
    Senior III
    January 12, 2018
    Posted on January 12, 2018 at 12:07

    As a general advice, you can always start a Linux GUI app from the terminal, which should give you indicative warnings/error messages in such cases.

    Roman Priesol
    Associate II
    September 25, 2018

    Hi guys, did you resolved this error? I am getting the same (oracle jdk-11 with openjfx)...

    > ./STM32CubeProgrammer

    JavaFX Installed

    chdir /opt/STM32CubeProgrammer/bin

    current dir /opt/STM32CubeProgrammer/bin

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

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

    Dean Perry
    Visitor II
    September 26, 2018
    Caused by: java.lang.NoClassDefFoundError: javafx/application/Application

    that's your problem there - you say you have installed JavaFX - investigate _which_ JREs you have installed (and which one has access to JavaFX libraries).

    On my Ubuntu box there are several and I am required to use a command called "update-java-alternatives" to select the appropriate one depending on which java based application I am using.

    Roman Priesol
    Associate II
    October 15, 2018

    Sure, I know. It uses JDK11 and JavaFX is installed. Other JavaFX applications works without any problems.

    Lars Beiderbecke
    Senior III
    January 11, 2019

    I have the same problem now, after upgrading to Java 11. openjfx is installed, and shows version 11. CubeProgrammer was working fine with Java 8.

    Is CubeProgrammer incompatible with Java 11? :(

    Dean Perry
    Visitor II
    January 16, 2019

    Well, I upgraded to (K)Ubuntu 18.10 and can no longer get it to work using update-java-alternatives - even (especially?) with openjdk-11 which has openjfx installed. Tried a few things to get this going unsuccessfully: a PPA for Ubuntu that installs Oracle JDK8 - alas not functional today; also version 1.4.0 of the STMCubeProgrammer.

    Interesting wrinkles are that the Trusted Package Creator launches from the shell and appears to work and appears to be using OpenJFX.

    The STM32_programmer_CLI works fine on 18.10 - I just programmed a board with it.

    I note with some interest in the 1.4.0 install there's a C++ library with a Qt example...

    Aymen Abderrahmen
    Visitor II
    January 16, 2019
    aymen.abderrahmen@st.com
    ADry
    Associate
    June 22, 2019

    Hi,

    I have some problems with launch CubeProg from Ubuntu.

    $ ./STM32CubeProgrammer

    /usr/local/STMicroelectronics/STM32CubeProgrammer/bin/STM32CubeProgrammerLauncher

    /usr/local/STMicroelectronics/STM32CubeProgrammer/bin

    JavaFX NOT installed => warn user

    0690X000008j4YSQAY.png

    But openjfx installed:

    $ dpkg -l | grep openjfx

    ii libopenjfx-java                      11.0.2+1-1~18.04.2                     all         JavaFX/OpenJFX - Rich client application platform for Java (Java libraries)

    ii libopenjfx-jni                       11.0.2+1-1~18.04.2                     amd64       JavaFX/OpenJFX - Rich client application platform for Java (native libraries)

    ii openjfx                              11.0.2+1-1~18.04.2                     amd64       JavaFX/OpenJFX - Rich client application platform for Java

    ii openjfx-source                       11.0.2+1-1~18.04.2                     all         JavaFX/OpenJFX - Rich client application platform for Java (sources)

    $ update-java-alternatives -l

    java-1.11.0-openjdk-amd64     1111      /usr/lib/jvm/java-1.11.0-openjdk-amd64

    Please any help!

    ADry
    Associate
    June 22, 2019

    SOLVED.

    Need doungrade jdk & jfx

    # apt install apt install openjdk-8-jdk openjfx=8u161-b12-1ubuntu2 libopenjfx-java=8u161-b12-1ubuntu2 libopenjfx-jni=8u161-b12-1ubuntu2

    than

    # update-alternatives --config java

    and set java-8-openjdk

    And hold the version:

    echo "openjfx hold"|dpkg --set-selections ; echo "libopenjfx-java hold"|dpkg --set-selections ; \

    echo "libopenjfx-jni hold"|dpkg --set-selections ; echo "openjfx-source hold"|dpkg --set-selections

    RLK
    Visitor II
    July 8, 2019

    I received the same error message from STM32CubeProgrammer 2.0.1 after upgrading Debian 9 "Stretch" (JRE v8) to Debian 10 "Buster" (JRE v11). I attempted to downgrade back to JRE/JFX v8:

    $ sudo apt install openjdk-8-jdk openjdk-8-jre openjfx=8u111-b14-1 libopenjfx-java=8u111-b14-1 libopenjfx-jni=8u111-b14-1

    STM32CubeProgrammer briefly started, but then crashed:

    # A fatal error has been detected by the Java Runtime Environment:
    #
    # SIGSEGV (0xb) at pc=0x00007ffb4b334ef8, pid=27084, tid=0x00007ffb9d9ef700
    #
    # JRE version: OpenJDK Runtime Environment (8.0_212-b01) (build 1.8.0_212-8u212-b01-1~deb9u1-b01)
    # Java VM: OpenJDK 64-Bit Server VM (25.212-b01 mixed mode linux-amd64 compressed oops)
    # Problematic frame:
    # C [libjfxwebkit.so+0x1883ef8]

    What worked for me was a wrapper script specifying Oracle JRE 8 64bit, as detailed in this thread:

    https://community.st.com/s/question/0D50X00009q3X4jSAE/stm32cubeprogrammer-for-linux

    Original script reproduced below. I downloaded jre-8u212-linux-x64.tar.gz and modified the script to suit.

     #!/bin/bash
     
     # Set path of Oracle JRE 8
     JAVA_HOME=/opt/jre1.8.0_202-amd64/
     
     PATH=$JAVA_HOME/bin/:$PATH
     
     # Unpack libraries, if necessary
     cd $JAVA_HOME/lib
     if [ ! -f rt.jar ]; then
     ../bin/unpack200 rt.pack rt.jar
     fi
     if [ ! -f jsse.jar ]; then
     ../bin/unpack200 jsse.pack jsse.jar
     fi
     if [ ! -f charsets.jar ]; then
     ../bin/unpack200 charsets.pack charsets.jar
     fi
     
     # CHeck Java version
     java -version
     
     # Start STM32 Cube Programmer
     cd /opt/STM32CubeProgrammer
     bin/STM32CubeProgrammer