Skip to main content
RBoer
Associate II
Aug 3, 2019 1:31 PM UTC
Question

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

On a more or less clean MacOS Mojave 10.14.6, installed the Oracle JDK (jdk-12.0.2_osx-x64_bin.dmg), installed the stm32cubeprogrammer (using the workaround via commandline). Now after installation, when starting it gives an error "The application “STM32CubeProgrammer�? can’t be opened."

​

Opening /Applications/.../Stm32CubeProgrammers/Contents/MacOS/bin/STM32CubeProgrammer

​

Shows the following problem in a terminal-box:

​

/Applications/STM32CubeProgrammer/STM32CubeProgrammer.app/Contents/MacOs/bin/STM32CubeProgrammer ; exit;

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

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

logout

Saving session...

...copying shared history...

...saving history...truncating history files...

...completed.

[Process completed]

​

In another post someone was having the same problem on Linux and the advice was to install javajfx, but as mentioned, it is said the be included in the 12.0.2 JDK... Any advice on how to get it to run?

This topic has been closed for replies.

10 replies

ffabi
Associate II
Aug 31, 2019 9:20 AM UTC

Unfortunately I have the same problem on MacOS. I would appreciate if someone knows a solution for this problem.

RMcGi
Visitor II
Sep 6, 2019 9:26 PM UTC

I also have this problem.

I read that javajfx is no longer included with the 12.0.2 JDK, but I'm unsure how to properly install javajfx.

APach.880
Visitor II
Nov 6, 2019 3:15 AM UTC

Facing same problem. Will post the solution if I find any

APach.880
Visitor II
Nov 6, 2019 5:02 PM UTC

Installed JDK 8 and it started fine.

Download link - https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

java version "1.8.0_231"

Java(TM) SE Runtime Environment (build 1.8.0_231-b11)

Java HotSpot(TM) 64-Bit Server VM (build 25.231-b11, mixed mode)

WWale.1
Associate
Jan 4, 2020 3:30 AM UTC

using Apach.880's link and uninstalling my current Java version (13), I was able to get this to work. Here's how to uninstall specific versions of Java:

https://www.youtube.com/watch?v=AfOKYjcaf0U&app=desktop

I only used the first 4 terminal inputs. Thanks for all the help. Feels great after sinking about 2 hours into this

ChrisH
Associate III
Aug 14, 2020 12:39 PM UTC

Still the same problem after a year and no one cares from ST, nice.

Chandrashekar C
Associate III
Aug 25, 2020 2:55 PM UTC

I face the same issue, do we have any solution for this?

FBusy.1
Visitor II
Oct 12, 2020 11:13 AM UTC

I used openjfx-15 solved this problem,download openjfx-15_linux-x64_bin-sdk.zip from https://openjfx.io/​, unzip to somewhere(such as :/usr/opt/),then modify the program startup file(${Program installation directory}/bin/STM32CubeProgrammer),may need sudo ,replace the last line "java -jar $DIR/STM32CubeProgrammerLauncher" with "java --module-path /usr/opt/javafx-sdk-15/lib --add-modules=javafx.base --add-modules=javafx.fxml --add-modules=javafx.graphics --add-modules=javafx.media --add-modules=javafx.swing --add-modules=javafx.web --add-modules=javafx.controls -jar $DIR/STM32CubeProgrammerLauncher", "/usr/opt/javafx-sdk-15/lib" is your openjfx's path, and my javasdk is jdk11, I also tried jdk12, also worked well.

DBitt.1
Associate
Nov 1, 2020 9:23 PM UTC

I'm confused. I don't have a launcher file that I can find to edit. I downloaded the macos files for openjfx jmods and sdk. Still not sure what to do here. Thanks.

AHobb.1
Visitor II
Nov 13, 2020 6:45 PM UTC

I have the same, no launcher