2020-02-24 07:41 AM
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?
Solved! Go to Solution.
2020-07-30 11:21 AM
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:
Installation of STM32CubeProgrammer:
PS path\to\cubeprog> java -jar .\SetupSTM32CubeProgrammer-2.5.0.exe
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
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
2020-03-30 03:23 AM
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
2020-07-30 11:21 AM
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:
Installation of STM32CubeProgrammer:
PS path\to\cubeprog> java -jar .\SetupSTM32CubeProgrammer-2.5.0.exe
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
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
2020-08-05 08:11 AM
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.
2020-08-10 03:46 AM
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.
2020-08-10 03:56 AM
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 :)
2020-10-10 02:59 AM
Many thanks - works brilliantly!
A different way to start without a terminal window:
cd C:\apps\STM32CubeProgrammer\bin
start "Starting STM32CubeProgrammer.." javaw --module-path "C:\apps\javafx-sdk-15\lib" --add-modules javafx.controls,javafx.fxml,javafx.web -jar .\STM32CubeProgrammer.exe
::Optional - keep console open for a short while while loading - adjust n to match loading time
::ping 127.0.0.1 -n 4 >NULL
2023-12-13 09:34 PM
Issue is fixed by adding -Djna.nosys=true in the newline in C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin\STM32CubeProgrammer.l4j.ini