Skip to main content
Pascal Rosin
Associate II
February 24, 2020
Solved

How to run CubeProgrammer on Windows 10 with AdoptOpenJDK

  • February 24, 2020
  • 3 replies
  • 2606 views

I am using AdoptOpenJDK 11. CubeMX is running with this after installing it from the commandline but CubeProgrammer is not starting (complainding "This application requires a Java Runtime Environment 1.8.0 - 10.99.99").

When trying to start it from the commandline with

STM32CubeProgrammer\bin> java -jar .\STM32CubeProgrammer.exe

it says "Main Class com.st.app.Main could not be found or loaded. Reason: java.lang.NoClassDefFoundError: javafx/application/Application"

Is there a way to run CubeProgrammer without Oracle's Java?

This topic has been closed for replies.
Best answer by Pascal Rosin

There is a way to run the STM32CubeProgrammer with AdoptOpenJDK 11, but you will also need to install an OpenJFX SDK. I am using JavaFX 14 from here.

Installation of OpenJFX:

  • Unzip the downloaded SDK
  • Rename the unzipped directory to `javafx-sdk-14`
  • Use Admin rights to copy the directory to `c:\Program Files\` or whatever

Installation of STM32CubeProgrammer:

  • Unzip the installer to `cubeprog`.
  • Run the following from an administrator PowerShell:
PS path\to\cubeprog> java -jar .\SetupSTM32CubeProgrammer-2.5.0.exe
  • To start the GUI Programmer, run the following from PowerShell:
PS path\to\STM32CubeProgrammer\bin> java --module-path "c:\Program Files\javafx-sdk-14\lib" --add-modules javafx.controls,javafx.fxml,javafx.web -jar .\STM32CubeProgrammer.exe
  • To run it from the start menu without a terminal window being opened, create a file `run.vbs` in the programmers bin directory, put the following in and change the start menu's link target to this `run.vbs` file:
CreateObject("Wscript.Shell").Run "cmd /C java --module-path ""c:\Program Files\javafx-sdk-14\lib"" --add-modules javafx.controls,javafx.fxml,javafx.web -jar STM32CubeProgrammer.exe", 0, True

3 replies

Houda GHABRI
ST Employee
March 30, 2020

Hi @Pascal Rosin​ ,

Only Java 8 is supported for STM32CubeProgrammer, on windows you can use Oracle JRE 8 prior to 1.8u211(free) .

regards,

Houda

Pascal Rosin
Associate II
August 10, 2020

The thing is that old JRE 8 versions are not allowed in my company due to security concerns. And for newer versions therer are licensing concerns :)

Pascal Rosin
Pascal RosinAuthorBest answer
Associate II
July 30, 2020

There is a way to run the STM32CubeProgrammer with AdoptOpenJDK 11, but you will also need to install an OpenJFX SDK. I am using JavaFX 14 from here.

Installation of OpenJFX:

  • Unzip the downloaded SDK
  • Rename the unzipped directory to `javafx-sdk-14`
  • Use Admin rights to copy the directory to `c:\Program Files\` or whatever

Installation of STM32CubeProgrammer:

  • Unzip the installer to `cubeprog`.
  • Run the following from an administrator PowerShell:
PS path\to\cubeprog> java -jar .\SetupSTM32CubeProgrammer-2.5.0.exe
  • To start the GUI Programmer, run the following from PowerShell:
PS path\to\STM32CubeProgrammer\bin> java --module-path "c:\Program Files\javafx-sdk-14\lib" --add-modules javafx.controls,javafx.fxml,javafx.web -jar .\STM32CubeProgrammer.exe
  • To run it from the start menu without a terminal window being opened, create a file `run.vbs` in the programmers bin directory, put the following in and change the start menu's link target to this `run.vbs` file:
CreateObject("Wscript.Shell").Run "cmd /C java --module-path ""c:\Program Files\javafx-sdk-14\lib"" --add-modules javafx.controls,javafx.fxml,javafx.web -jar STM32CubeProgrammer.exe", 0, True

MWojc.2
Associate
August 5, 2020

I have no "--module-path" option. Any way around this?

Using the ST tools on windows is somewhat painful because of java not being the right version.

Pascal Rosin
Associate II
August 10, 2020

With AdoptOpenJDK 11, your `java` command should have a `--module-path` option. If not, you have probably another java version installed and in your path. Check `java --version` it says `openjdk 11.0.8 2020-07-14` in the first line on my computer.

If you are using a Java version by Oracle, there would be no need for the `--module-path` option because JavaFX is integrated in Oracle Java, so you won't need to tell java where the JavaFX modules are to be found. With Oracle Java other than Java 8 Just try

java -jar .\STM32CubeProgrammer.exe

or maybe

java --add-modules javafx.controls,javafx.fxml,javafx.web -jar .\STM32CubeProgrammer.exe

to run the programmer.

Visitor II
December 14, 2023

Issue is fixed by adding -Djna.nosys=true in the newline in C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin\STM32CubeProgrammer.l4j.ini