Compilation error '/esptool.exe' not recognized

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

exit status 1

Compilation error: exit status 1

Arduino ide 2.0.4 suddenly gives me this error. First time it happens...
how to fix this?

Found the answer. Install previous version of ESP32 Espressif and then reinstall latest version.

3 Likes

Uninstall 2.0.7 of esp32 and then reinstall does the same thing. Thanks for the pointer - I had the same issue after updating to 2.0.4.

5 Likes

You saved my day! :kissing_heart:

Thank you @jacv2 and @rcmontrose for the quick fix to this goofy problem.

I was also surprised this morning, days after installing and using IDE2.0.4, to find my ESP32s suddenly didn't compile.

Much appreciated. Life is better now. Sun is out. Snow melted. Ahhhh.

Thanks Guys
Same problem
it worked fine for a couple of weeks and then crashed before the error raised its head
reinstalled all fine now

Hi all. I did some investigation and found the cause of the error was a change made to the ESP32 package index. I reported the problem to the ESP32 developers:

Good lookin out, was about to be a night destroyer for me probably

Can someone guide me to go back to the previous version? I have version 2.0.7

Hi @yony445. It is not necessary to go back to the previous version. You can solve the problem by uninstalling and reinstalling version 2.0.7 of the ESP32 boards platform.

Which version of Arduino IDE are you using (e.g., "2.0.1")? The version is shown on the window title bar and also in the Help > About dialog.

I ask for this information because I want to give you the appropriate instructions for the IDE version you are using.

Hi @ptillisch! Just wanted to follow up on this.

I just updated to Arduino IDE version 2.0.4, and I have been facing the same issue:

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

exit status 1

Compilation error: exit status 1

Would you be able to provide/reference instructions on how to downgrade to the version of ESP32 boards that does not have this issue?

Thanks!

Although the downgrade is one workaround, it is not necessary. You can simply uninstall and then reinstall 2.0.7 so that you will benefit from using the latest and greatest version of the ESP32 boards platform.

Here are the instructions for doing that:

  1. Select Tools > Board > Boards Manager from the Arduino IDE menus to open the "Boards Manager" view in the left side panel.
  2. Scroll down through the list of boards platforms until you find the "esp32 by Espressif Systems" entry.
  3. Hover the mouse pointer over the "INSTALLED" label on the "esp32 by Espressif Systems" entry. You will now see it change to an "UNINSTALL" button.
  4. Click the "UNINSTALL" button.
  5. A confirmation dialog will appear. Click the "YES" button.
  6. Wait for the uninstallation to finish.
  7. Select "2.0.7" from the dropdown version menu at the bottom of the "esp32 by Espressif Systems" entry.
  8. Click the "INSTALL" button at the bottom of the "esp32 by Espressif Systems" entry.
  9. Wait for the installation to finish.

Please let me know if you have any questions or problems while following those instructions.

3 Likes

When I wont to uninstall or update I got message "java.lang.NullPointerException" and nothing happens :frowning:

Hi @simonsko. I'm going to ask you to post some additional information that might help us to identify the problem.

Please do this:

  1. Close all Arduino IDE windows.
  2. Start Arduino IDE.
    (this restart was done to start from a blank console panel)
  3. Select Tools > Board > Boards Manager from the Arduino IDE menus.
  4. Attempt to update the "esp32 by Espressif Systems" boards platform.
  5. After the process fails, click the Close button.
  6. Click on the black console panel at the bottom of the Arduino IDE window.
  7. Press Ctrl+A to select all the text.
  8. Press Ctrl+C.
    This will copy the selected text to the clipboard.
  9. Open a forum reply here by clicking the Reply button.
  10. Click the <CODE/> icon on the post composer toolbar. This will add the forum's code block markup (```) to your reply to make sure the error messages are correctly formatted.
    Code tags icon on toolbar
  11. Press Ctrl+V.
    This will paste the copied text into the code block.
  12. Move the cursor outside of the code block markup before you add any additional text to your reply.
  13. Click the Reply button to post the output.

I'm hoping there will be some additional information in the Arduino IDE console that might help us to understand the cause of the error you experienced. There are a lot of possible causes of this generic "java.lang.NullPointerException" error.

I cannot do enything. I got an error

This I got from window

java.lang.NullPointerException
java.lang.RuntimeException: java.lang.NullPointerException
	at cc.arduino.contributions.packages.ui.ContributionManagerUI.lambda$onInstallPressed$2(ContributionManagerUI.java:179)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException
	at cc.arduino.contributions.packages.ContributionInstaller.remove(ContributionInstaller.java:275)
	at cc.arduino.contributions.packages.ui.ContributionManagerUI.lambda$onInstallPressed$2(ContributionManagerUI.java:170)
	... 1 more

I have the same issue. Unable to uninstall esp32 from boards manager.
Should we remove install files manually?

java.lang.NullPointerException
java.lang.RuntimeException: java.lang.NullPointerException
at cc.arduino.contributions.packages.ui.ContributionManagerUI.lambda$onRemovePressed$3(ContributionManagerUI.java:213)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException
at cc.arduino.contributions.packages.ContributionInstaller.remove(ContributionInstaller.java:276)
at cc.arduino.contributions.packages.ui.ContributionManagerUI.lambda$onRemovePressed$3(ContributionManagerUI.java:210)
... 1 more

How to manually remove files?
I did try to remove package_esp32_index.json and cache directory from C:\Users\simon\AppData\Local\Arduino15
but when I run arduino IDE was resorted automatically. And of course same problem..

@simonsko and @crashsoft, which version of Arduino IDE are you using (e.g., "1.8.19")? The version is shown on the window title bar and also in the Help > About dialog.

Please also tell me which operating system you are using (e.g., "Windows").

I ask for this information because I just tried updating my ESP32 boards platform from 2.0.7 to 2.0.8 with Arduino IDE 1.8.19 on my Windows machine. I do see some warnings, but I didn't experience the error you reported and the update was succesful.

Arduino 1.8.13 on Windows 10