cancel
Showing results for 
Search instead for 
Did you mean: 

Can not start STM32CubeProgrammer under Debian

Cedric Boudinet
Associate III
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

35 REPLIES 35
Roman Priesol
Associate II

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

Lars Beiderbecke
Senior III

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
Associate III

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
Associate
aymen.abderrahmen@st.com
ADry
Associate II

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 II

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

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

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: 

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
Associate

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
Associate

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