Error uploading sketch to Arduino

So I just got an Arduino Uno and I’m trying to upload sketches to it but I keep getting this error message:
Sketch uses 930 bytes (2%) of program storage space. Maximum is 32256 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.
java.io.IOException: Cannot run program “{runtime.tools.avrdude.path}/bin/avrdude”: CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at processing.app.helpers.ProcessUtils.exec(ProcessUtils.java:26)
at cc.arduino.packages.Uploader.executeUploadCommand(Uploader.java:129)
at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:207)
at cc.arduino.UploaderUtils.upload(UploaderUtils.java:78)
at processing.app.SketchController.upload(SketchController.java:732)
at processing.app.SketchController.exportApplet(SketchController.java:703)
at processing.app.Editor$DefaultExportHandler.run(Editor.java:2197)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.(ProcessImpl.java:386)
at java.lang.ProcessImpl.start(ProcessImpl.java:137)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
… 8 more
An error occurred while uploading the sketch

I think I have the drivers installed correctly, and I can’t figure out why this is happening. Anyone have any ideas?

Java is no loading runtime.tools.avrdude.path variable.

This indicates something has gone wrong with your Arduino AVR Boards installation. To make sure it has been fully uninstalled you need to take some drastic action. Be aware this is somewhat advanced and will remove all boards you have installed via Boards Manager:

  • Click the link on the line following File > Preferences > More preferences can be edited directly in the file. This will open the Arduino15 (or similar name depending on OS) folder.
  • Delete all files and folders under the Arduino15 folder except for preferences.txt. Please be very careful when deleting things from your computer. When in doubt back up!
  • Restart the Arduino IDE

Verify that you can now use your board before reinstalling any packages via Boards Manager.

Hey there,

I make this mistake myself sometimes :smiley: :smiley:

If you click the “Tools” button you will find a section that says: Board:“Whatever board is selected”. By clicking on that you will get a menu with all the Arduino/Genuino boards. Select the one you are using.
This might help but if it doesn’t there is other reasons it won’t upload that I don’t know.

Hope this helps :slight_smile: