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

It works perfectly for me, thanks!

robertwood9170
Associate II

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

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 ?

Isidre Sole
Associate III

Same behavior here with a Debian 10.

I downgraded openjfx and now when I execute the STM32CubeProgrammer from command line I get the following result:

 ./STM32CubeProgrammer

Jun 17, 2020 3:29:10 PM javafx.fxml.FXMLLoader$ValueElement processValue

WARNING: Loading FXML document with JavaFX API of version 8.0.121 by JavaFX runtime of version 8.0.111

jar:file:/home/isidre/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$5(GtkApplication.java:139)

at java.lang.Thread.run(Thread.java:748)

SFrin
Associate II

You need to start the STM32 Cube Programmer with Oracle Java 8. See https://community.st.com/s/question/0D50X00009q3X4jSAE/stm32cubeprogrammer-for-linux?t=1593874663726 where the same topic is discussed.

MMatj.1
Associate II

Possibly one more quick solution found in another thread:

https://community.st.com/s/question/0D50X0000BsRNNVSQ4/stm32cubeprogrammer-execute-fail-with-could-not-find-or-load-main-class-comstappmain

For programmer had to install Liberica / bellsoft-jdk8u265+1-linux-amd64-full.deb