Skip to main content
Pascal Rosin
Associate II
Feb 24, 2020 3:41 PM UTC
Solved

How to run CubeProgrammer on Windows 10 with AdoptOpenJDK

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.
Pascal Rosin
Pascal RosinBest answer
Associate II
Jul 30, 2020 6:21 PM UTC

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

7 replies

Houda GHABRI
ST Employee
Mar 30, 2020 10:23 AM UTC

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
Aug 10, 2020 10:56 AM UTC

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
Jul 30, 2020 6:21 PM UTC

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
Aug 5, 2020 3:11 PM UTC

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
Aug 10, 2020 10:46 AM UTC

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
Dec 14, 2023 5:34 AM UTC

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