Skip to main content
RBoer
Associate II
August 3, 2019
Question

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

  • August 3, 2019
  • 8 replies
  • 3683 views

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.

8 replies

ffabi
Associate II
August 31, 2019

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

RMcGi
Visitor II
September 6, 2019

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
November 6, 2019

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

APach.880
Visitor II
November 6, 2019

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
January 4, 2020

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
August 14, 2020

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

Chandrashekar C
Associate III
August 25, 2020

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

FBusy.1
Visitor II
October 12, 2020

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
November 1, 2020

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
November 13, 2020

I have the same, no launcher