Skip to content

"'java' is not recognized" error with Arduino 2.0.3 and maple 2 uploader #88

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
clawsoon opened this issue Jan 24, 2023 · 8 comments
Closed
Labels
duplicate This issue or pull request already exists question ❓ Usually converted as a discussion

Comments

@clawsoon
Copy link

I just installed Arduino 2.0.3 and attempted to upload to a previously working Generic STM32F1 (Blue Pill) board using Maple DFU Bootloader 2.0. I got the error:

'java' is not recognized as an internal or external command,
operable program or batch file.

I assume this error is related to the fact that Arduino is no longer built on Java.

I tried to install my own Java version, but then I got the error reported in this previous bug:

#67

Any hints, fixes or workarounds would be appreciated.

Thanks.

@fpistm
Copy link
Member

fpistm commented Jan 24, 2023

Hi @clawsoon
unfortunately, I've no easy solution.
This kind of uploader was provided for legacy wqith roger's core. I gues it is the same issue with it.
You can edit the script and force to call the java from arduino 1.8.x with full path.

As stated in #67, the best solution would be to implement a small binary to perform the uart stuff like that we could remove this .jar.
Else I will simply remove this upload method and mark it as deprecated and no more suported.

@clawsoon
Copy link
Author

Hi @fpistm
I tried it with Arduino 1.8.19 and got the error:

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 3
at CliTemplate.CliMain.main(CliMain.java:33)
timeout waiting for 2 serial

Poking around, it sounds like it needs a very specific Java version (maybe from an even older Arduino IDE?)

What alternate upload method would you recommend? I don't have an STLink, just a USB cable, and some Blue Pills with the Maple stuff on them. I don't know exactly what I'm doing; I just don't want to brick my boards. :-)

@fpistm
Copy link
Member

fpistm commented Jan 24, 2023

Try to edit this line:
https://github.com/stm32duino/Arduino_Tools/blob/main/win/maple_upload.bat#LL8C11-L8C11

and give the full path of the java bin of your Arduino IDE 1.8.19
ex:
C:\IDE\arduino-1.8.19\java\bin\java -jar maple_loader.jar %1 %2 %3 %4 %5 %6 %7 %8 %9

@clawsoon
Copy link
Author

Would the HID bootloader be a more future-proof option? Or would it just not work at all for me?

@clawsoon
Copy link
Author

Installing 1.8.19 seems to have screwed up my drivers somehow, so now I'm heading down a completely different rabbit hole. Once that's sorted, I'll let you know if your java path workaround works.

Thanks.

@fpistm
Copy link
Member

fpistm commented Jan 24, 2023

HID could be an option

@clawsoon
Copy link
Author

I got the upload working again using an old install_drivers.bat that uses wdi-simple.exe. Your 1.8.19 java suggestion seems to have worked, though if anyone is reading this in the future I'd suggest installing 1.8.19 before installing 2.0.X, to hopefully avoid the driver issues I experienced.

Thanks for your help, @fpistm .

@fpistm
Copy link
Member

fpistm commented Feb 9, 2023

I close this one as it is the same subject than #67.
Fix would be to remove the .jar.

@fpistm fpistm closed this as completed Feb 9, 2023
@fpistm fpistm added duplicate This issue or pull request already exists question ❓ Usually converted as a discussion and removed Duplicated labels Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists question ❓ Usually converted as a discussion
Projects
None yet
Development

No branches or pull requests

2 participants