STM32F103C8T6(Black Pill) arduino upload issue

Hi @paramountain55.

Explanation

I think the cause of the error is explained here:

https://github.com/rogerclarkmelbourne/Arduino_STM32/issues/834#issuecomment-1661152147

The 3rd party "STM32F1xx/GD32F1xx boards" platform from Roger Clark that you are using to add support to Arduino IDE for the "Black Pill" board uses a tool named "maple_loader" to upload sketches to the board. maple_loader is written in the Java programming language, and so to use it you must have the appropriate Java Runtime Environment installed on your computer.

The Arduino IDE 1.x application is written in the Java programming language, and so the installation of that version of Arduino IDE includes a copy of the Java Runtime Environment. Because the "STM32F1xx/GD32F1xx boards" platform was developed during the Arduino IDE 1.x era, the assumption was made that any user of Arduino IDE will have that specific version of the Java Runtime Environment installed, so the developers of the platform didn't bother to make any provisions to supply that dependency of maple_loader.

Arduino IDE 2.x is a complete rewrite of the Arduino IDE application. This application is written in the TypeScript programming language instead of Java so the Arduino IDE 2.x installation does not include a copy of the Java Runtime Environment. This means that when you use the "STM32F1xx/GD32F1xx boards" platform with Arduino IDE 2.x, it attempts to use your global installation of the Java Runtime Environment. The problem with that is the maple_loader tool is written specifically for the version of Java provided by Arduino IDE 1.x. Your global system installation is a different Java version that is not compatible with maple_loader.

Solution

The most simple solution would be to use the actively maintained "STM32 MCU based boards" platform instead of the largely abandoned "STM32F1xx/GD32F1xx boards" platform you are using now.

You can learn how to install the STM32 MCU based boards" platform from that project's documentation:

https://github.com/stm32duino/Arduino_Core_STM32?tab=readme-ov-file#getting-started

Alternative solution

In case you have a specific reason for using the Roger Clark "STM32F1xx/GD32F1xx boards" platform, the alternative simple solution would be to use Arduino IDE 1.8.19 instead of 2.x. The download links for Arduino IDE 1.8.19 are listed here:

https://www.arduino.cc/en/software#legacy-ide-18x

Installations of Arduino IDE 1.8.19 and 2.x can coexist on your computer without any problems so if you want to continue to use Arduino IDE 2.x for other boards then you are welcome to leave it installed and switch back and forth between the two different IDE versions as you like.