Arduino compilling error with java

Hellot everybody!
when I used this code:

const int LED=9;
const int BUTTON=2;

void setup() {
  pinMode (LED, OUTPUT);
  pinMode (BUTTON, INPUT);

}

void loop() {
  if (digitalRead(BUTTON) == LOW); 
  {
    digitalWrite(LED, LOW);
  }
  else {
    digitalWrite(LED, HIGH);
    }

}

the arduino IDE displayed me an error:

processing.app.debug.RunnerException
	at cc.arduino.Compiler.callArduinoBuilder(Compiler.java:317)
	at cc.arduino.Compiler.loadPreferences(Compiler.java:216)
	at cc.arduino.Compiler.build(Compiler.java:175)
	at processing.app.SketchController.build(SketchController.java:664)
	at processing.app.SketchController.exportApplet(SketchController.java:689)
	at processing.app.Editor$UploadHandler.run(Editor.java:2061)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.IOException: Cannot run program "C:\Users\Andrey\Desktop\arduino-nightly\arduino-builder": 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.Compiler.callArduinoBuilder(Compiler.java:297)
	... 6 more
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.<init>(ProcessImpl.java:386)
	at java.lang.ProcessImpl.start(ProcessImpl.java:137)
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
	... 8 more

please help if smbd can understand this
AND YET IT DISPLAYING BACKGROUND COLOR RED ON A FIRSTEST LINE OF CODE

doubt the above is the cause of java error, but the semicolon, ";" should be removed because it becomes the body of the if statement and results in an "else" without matching "if"

1 Like

Why are you running a nightly build? They are test versions of software and might or might not work as expected.

Does the same oroblem show when you try to upload e.g. blink? If yes, I suspect that you have a corrupt installation.

Are you using the web based ide ?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.