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

Can not start STM32CubeProgrammer under Debian

  • January 11, 2018
  • 35 replies
  • 8335 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.

    35 replies

    JasonZ
    Associate II
    October 22, 2019

    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: 

    jiang@Jiang-Ubuntu18:~$ STM32CubeProgrammer

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

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

    jiang@Jiang-Ubuntu18:~$ 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)

    jiang@Jiang-Ubuntu18:~$ 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)

    jiang@Jiang-Ubuntu18:~$ 

    manuksh
    Visitor II
    November 4, 2019

    Hi guys. The same issue I have with java. Cannot download Oracle Java,OpenJDK is preferable as there are lot of software components which are developed with OpenJDK.

    sL1pKn07
    Visitor II
    November 25, 2019

    Only works with OpenJDK < v8, tested with v11 to v13, all fail to load

    and with v8, get a lot of warnings

    ┌─┤[$]|[sl1pkn07]|[sL1pKn07]|[~/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin]|
    └───╼ ./STM32CubeProgrammer
    No properties file found
    java.io.FileNotFoundException: /home/sl1pkn07/.STM32CubeProgrammer/config.properties (No existe el fichero o el directorio)
     at java.io.FileInputStream.open0(Native Method)
     at java.io.FileInputStream.open(FileInputStream.java:195)
     at java.io.FileInputStream.<init>(FileInputStream.java:138)
     at java.io.FileInputStream.<init>(FileInputStream.java:93)
     at com.st.controllers.MainWindowController.initialize(MainWindowController.java:292)
     at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2548)
     at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2441)
     at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3214)
     at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3175)
     at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3148)
     at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3124)
     at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3104)
     at javafx.fxml.FXMLLoader.load(FXMLLoader.java:3097)
     at com.st.app.Main.start(Main.java:38)
     at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$8(LauncherImpl.java:863)
     at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$7(PlatformImpl.java:326)
     at com.sun.javafx.application.PlatformImpl.lambda$null$5(PlatformImpl.java:295)
     at java.security.AccessController.doPrivileged(Native Method)
     at com.sun.javafx.application.PlatformImpl.lambda$runLater$6(PlatformImpl.java:294)
     at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
     at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
     at com.sun.glass.ui.gtk.GtkApplication.lambda$null$10(GtkApplication.java:245)
     at java.lang.Thread.run(Thread.java:748)
    jar:file:/home/sl1pkn07/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin/STM32CubeProgrammerLauncher!/fxml/Config.fxml
    java.lang.ClassNotFoundException: com.sun.deploy.uitoolkit.impl.fx.HostServicesFactory
     at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
     at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
     at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
     at java.lang.Class.forName0(Native Method)
     at java.lang.Class.forName(Class.java:348)
     at com.sun.javafx.application.HostServicesDelegate.lambda$getInstance$0(HostServicesDelegate.java:52)
     at java.security.AccessController.doPrivileged(Native Method)
     at com.sun.javafx.application.HostServicesDelegate.getInstance(HostServicesDelegate.java:45)
     at javafx.application.HostServices.<init>(HostServices.java:52)
     at javafx.application.Application.getHostServices(Application.java:334)
     at com.st.app.Main.start(Main.java:51)
     at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$8(LauncherImpl.java:863)
     at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$7(PlatformImpl.java:326)
     at com.sun.javafx.application.PlatformImpl.lambda$null$5(PlatformImpl.java:295)
     at java.security.AccessController.doPrivileged(Native Method)
     at com.sun.javafx.application.PlatformImpl.lambda$runLater$6(PlatformImpl.java:294)
     at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
     at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
     at com.sun.glass.ui.gtk.GtkApplication.lambda$null$10(GtkApplication.java:245)
     at java.lang.Thread.run(Thread.java:748)
     
    (java:1397575): Gtk-WARNING **: 16:27:18.763: Imposible encontrar el motor de temas en la ruta al _modulo: «adwaita»,
     
    (java:1397575): Gtk-WARNING **: 16:27:18.768: Imposible encontrar el motor de temas en la ruta al _modulo: «adwaita»,
    Exception in thread "JavaFX Application Thread" java.lang.NullPointerException
     at com.st.controllers.MainWindowController$1.run(MainWindowController.java:208)
     at com.sun.javafx.application.PlatformImpl.lambda$null$5(PlatformImpl.java:295)
     at java.security.AccessController.doPrivileged(Native Method)
     at com.sun.javafx.application.PlatformImpl.lambda$runLater$6(PlatformImpl.java:294)
     at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
     at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
     at com.sun.glass.ui.gtk.GtkApplication.lambda$null$10(GtkApplication.java:245)
     at java.lang.Thread.run(Thread.java:748)
    55 external Loader list
     

    greetings

    Carlos Soria
    Visitor II
    December 1, 2019
    RLour.1
    Associate II
    January 19, 2020

    Great! A wasted Sunday morning. Someone please post to this thread when they get it fixed.

    Rich

    MHHH.1
    Visitor II
    February 23, 2020

    Carlos' advisory above may have been valid 3 months ago but it's NOT TRUE now -- I can vouch for having it working on an Ubuntu 18.04 desktop, after installing JFX.

    BUT.. am not in the office today (Sunday) and am trying to get it going on a laptop, trying to remember what else I had to do... sorry not hugely helpful but I assure you it will run on 18.04. I use it daily.

    MHHH.1
    Visitor II
    February 23, 2020

    SOLUTION for Ubuntu 18.04 CURRENT 22 Feb 2020:   The detail advice is provided in ST's USER MANUAL for the Programmer, which is here:   

    https://www.st.com/content/ccc/resource/technical/document/user_manual/group0/76/3e/bd/0d/cf/4d/45/25/DM00403500/files/DM00403500.pdf/jcr:content/translations/en.DM00403500.pdf   

    Relevant instructions for Ubuntu 18.04 are: 

    To get STM32CubeProgrammer working with Ubuntu ® 18.04

    1. Install OpenJDK 8

    a) sudo apt install openjdk-8-jre-headless

    2. Set OpenJDK 8 as your default Java Runtime Engine

    a) sudo update-alternatives --config java

    3. Install OpenJFX

    a) sudo apt purge openjfx

    b) sudo apt install openjfx=8u161-b12-1ubuntu2 libopenjfx-jni=8u161-b12-1ubuntu2

    libopenjfx-java=8u161-b12-1ubuntu2

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

    To install the STM32CubeProgrammer tool, you need to download and extract the zip

    package and execute SetupSTM32CubeProgrammer-vx.y.z.linux, which guides you through the installation process.

    ~~~~~~~~~

    I've just done this on Ubuntu 18.04 on an i5 and it works fine now.  

    (And I remember now this was what I had to do a few months back on the desktop mentioned above).  

    Good luck all.

    AKucy.1
    Visitor II
    January 30, 2020

    Solution from below link fixed my problem:

    https://www.fosstechnix.com/install-oracle-java-8-on-ubuntu/

    Greetings

    kuadamku

    STerr
    Visitor II
    February 17, 2020

    Managed to make it work on Ubuntu 18.04 with the following:

    • make sure java8 is installed
    update-java-alternatives -l
    • select java8 on your system with:
    sudo update-java-alternatives -s java-1.8.0-openjdk-amd64
    • uninstall any openjfx 11 components
    sudo apt remove openjfx libopenjfx-java libopenjfx-jni libopenjfx-java-doc openjfx-source --purge

    • install openjfx 8
    sudo apt install libopenjfx-java=8u161-b12-1ubuntu2

    AKucy.1
    Visitor II
    February 17, 2020

    No, your way doesn't work. Mine works 100%

    MHHH.1
    Visitor II
    February 23, 2020

    I tried your way but that didn't work for me. Solved : see my update above -- I find the instructions from the User Manual work fine:

    https://www.st.com/content/ccc/resource/technical/document/release_note/group0/0e/66/57/b4/f9/ee/4f/73/DM00441049/files/DM00441049.pdf/jcr:content/translations/en.DM00441049.pdf

    rclar.6
    Associate III
    March 19, 2020

    I wish this did use OpenJDK. This could mean oracle would have control of the IDE under linux.

    sL1pKn07
    Visitor II
    March 19, 2020

    work with OpenJDK, but version 8

    robertwood9170
    Associate
    April 30, 2020

    I have followed the downgrade instructions and can now run Cube Programmer on Ubuntu 18.04, but when I start it from the command line, I get:

    > /usr/local/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin/STM32CubeProgrammer

    jar:file:/usr/local/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin/STM32CubeProgrammerLauncher!/fxml/Config.fxml

    java.lang.ClassNotFoundException: com.sun.deploy.uitoolkit.impl.fx.HostServicesFactory

       at java.net.URLClassLoader.findClass(URLClassLoader.java:382)

       at java.lang.ClassLoader.loadClass(ClassLoader.java:418)

       at java.lang.ClassLoader.loadClass(ClassLoader.java:351)

       at java.lang.Class.forName0(Native Method)

       at java.lang.Class.forName(Class.java:348)

    ...

    Also, I can now connect to STM32WB55.USBDONGLE, but I can't read the memory and the device information is not showing. Whey I googled the above error, it appears it was a bug fixed in a later version of openjfx (There is an existing bug on Mac platform that showDocument() will lead to an illegalAccessException. To workaround this problem an --add-exports option is required, i. e. --add-exports=java.desktop/com.apple.eio=javafx.graphics ) that is not available for Ubuntu 18.04 and I don't know how to apply the fix. I also had udev problems that I hopefully fixed properly. Does anyone have Programmer working for a WB55 dongle on Ubuntu 18.04? Is there any visibility on how to get around these problems? Is it expected that ST will address this or should I look for anothe alternative or just give up on the dongle? Any suggestions are appreciated. Thank you.

    RSacc.1
    Graduate
    May 1, 2020

    Got the same issue on Ubuntu 18.04 LTS, installed EVERYTHING as described Oracle JDK + JRE, and openjdk using sudo apt get and by hand.

    Even tried compiling a java example using Jfx as per the openjfx :

    https://openjfx.io/openjfx-docs/#install-javafx

    javac --module-path $PATH_TO_FX --add-modules javafx.controls,javafx.fxml HelloFX.java

    The example compiled fine but i tried it many times using sudo and not and the STcube programmer exec keeps failing !!!

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

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

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

    JDK/JRE

     java -version

    java version "11.0.7" 2020-04-14 LTS

    Java(TM) SE Runtime Environment 18.9 (build 11.0.7+8-LTS)

    Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.7+8-LTS, mixed mode)

    echo $JAVA_HOME

    /opt/jdk/usr/lib/jvm/jdk-11.0.7

    romain@romain-linux:/opt/jdk/usr/lib/jvm/jdk-11.0.7/lib$ sudo update-alternatives --display java

    java - auto mode

     link best version is /opt/jdk/usr/lib/jvm/jdk-11.0.7/bin/java

     link currently points to /opt/jdk/usr/lib/jvm/jdk-11.0.7/bin/java

     link java is /usr/bin/java

    /opt/jdk/usr/lib/jvm/jdk-11.0.7/bin/java - priority 100

    /opt/jdk/javafx-sdk-11.0.2/lib$ ls

    javafx.base.jar     javafx.media.jar  javafx.web.jar    libavplugin-ffmpeg-56.so libglassgtk2.so      libjavafx_font_freetype.so libjfxmedia.so     libprism_sw.so

    javafx.controls.jar javafx.properties libavplugin-54.so libavplugin-ffmpeg-57.so libglassgtk3.so      libjavafx_font_pango.so    libjfxwebkit.so    src.zip

    javafx.fxml.jar     javafx.swing.jar  libavplugin-56.so libdecora_sse.so         libglass.so          libjavafx_font.so          libprism_common.so

    javafx.graphics.jar javafx-swt.jar    libavplugin-57.so libfxplugins.so          libgstreamer-lite.so libjavafx_iio.so           libprism_es2.so

    There you go all proof that everything is done by the book:

    1) java home configure

    2) java and javac installed

    3) ubuntu is configured with the right kit

    4) libs from openjfx reside in the JDK lib directory

    PLEASE help i think that ubuntu 18 is very mainstream and this should work when the oracle JDK and JRE are installed as per the book and same for the openJFX.

    Thanks by advance !

    This is really hard to believe that with about 12 years of experience as a developer i cannot get STM32cube to work.

    Not a good look and first impression to say the least...

    And btw why arent all these instructions about jfx not included in your installer or in a README ?