error trying to run arduino ide

I was using the arduino ide that I got with apt-get and it was working but i wanted the new version so uninstalled it
and installed version 1.8.10 from the tar file.
The instructions I was following told me to move the extracted directory to /opt. So I did that and then did
sudo ./install.sh from /opt. It appeared to install OK but now it won't open from the icon.

I get the following error when I try to open the ide with sudo arduino

pi@raspberrypi:~ $ sudo arduino
/usr/local/bin/arduino: line 35: /opt/arduino-1.8.10/java/bin/java: cannot execute binary file: Exec format error

Is the problem something about JAVA versions? I also saw you can get that error when trying to run 64 bit software
on a 32 bit machine but I don't think it's that. This is a raspberry Pi so i installed the 32 bit version of 1.8.10.

pi@raspberrypi:~ $ arch
armv7l

I don't know where to go from here

Did you use the "Linux ARM 32 bits" or the "Linux 32 bits" download link?

Oh, I think it was Linux 32 bits. I didn't know about Linux ARM 32 bits.

So should I uninstall? I think there's an uninstall script in the extracted directory

Yes, you need to use the "Linux ARM 32 bits" download on the Raspberry Pi.

Ok I installed 1.8.10 for linux arm. The ide opens but i can’t upload anything. no error messages it just gets stuck on uploading
I get a choice of 2 serial ports /dev/ttyAMA0 and /dev/ttyUSB0

I get this error message when I select USB0 and try to upload the I2C scanner sketch. It worked before and reported an
address of 0x27 for the I2c board …

Arduino: 1.8.10 (Linux), Board: “Arduino Nano, ATmega328P”

Sketch uses 3624 bytes (11%) of program storage space. Maximum is 30720 bytes.
Global variables use 516 bytes (25%) of dynamic memory, leaving 1532 bytes for local variables. Maximum is 2048 bytes.
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00
An error occurred while uploading the sketch

This report would have more information with
“Show verbose output during compilation”
option enabled in File → Preferences.

I also tried to upload a hello world sketch for the I2C board it just gets stuck on upload

LiquidCrystal_I2C_example.txt (1.12 KB)

I2C_scanner-1.txt (1.08 KB)

OK fixed ...... I had to select ATmega 328p (old bootloader) in Tools>Processor

I'm glad to hear you found the solution. Thanks for taking the time to post an update. Enjoy!