Error compiling Blink program


I'm brand new to programming and to Arduino and I have an error message at my very first attempt to compile program (the "Blink" example)

Have searched elsewhere on the Internet but cannot find exact issue

I have an Arduino / Genuino Uno.
Running Mac OSX 10.7.5
Have checked that I'm running latest version of Java ((Version 8 Update 144) [since the error message mentions Java]
Have checked in Tools that the correct board and Port are selected

Issue log below - would appreciate any advice

Arduino: 1.8.5 (Mac OS X), Board: "Arduino/Genuino Uno"

/Applications/ -dump-prefs -logger=machine -hardware /Applications/ -tools /Applications/ -tools /Applications/ -built-in-libraries /Applications/ -libraries /Users/rich/Documents/Arduino/libraries -fqbn=arduino:avr:uno -vid-pid=0X2A03_0X0043 -ide-version=10805 -build-path /var/folders/qf/0kv1rz_w8vl54h006s6kqlvh0000gn/T/arduino_build_77539 -warnings=none -build-cache /var/folders/qf/0kv1rz_w8vl54h006s6kqlvh0000gn/T/arduino_cache_794683 -prefs=build.warn_data_percentage=75 -verbose /Applications/
/Applications/ -compile -logger=machine -hardware /Applications/ -tools /Applications/ -tools /Applications/ -built-in-libraries /Applications/ -libraries /Users/rich/Documents/Arduino/libraries -fqbn=arduino:avr:uno -vid-pid=0X2A03_0X0043 -ide-version=10805 -build-path /var/folders/qf/0kv1rz_w8vl54h006s6kqlvh0000gn/T/arduino_build_77539 -warnings=none -build-cache /var/folders/qf/0kv1rz_w8vl54h006s6kqlvh0000gn/T/arduino_cache_794683 -prefs=build.warn_data_percentage=75 -verbose /Applications/
Using board 'uno' from platform in folder: /Applications/
Using core 'arduino' from platform in folder: /Applications/
Detecting libraries used...
"/Applications/" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-I/Applications/" "-I/Applications/" "/var/folders/qf/0kv1rz_w8vl54h006s6kqlvh0000gn/T/arduino_build_77539/sketch/Blink.ino.cpp" -o "/dev/null"
Generating function prototypes...
"/Applications/" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-I/Applications/" "-I/Applications/" "/var/folders/qf/0kv1rz_w8vl54h006s6kqlvh0000gn/T/arduino_build_77539/sketch/Blink.ino.cpp" -o "/var/folders/qf/0kv1rz_w8vl54h006s6kqlvh0000gn/T/arduino_build_77539/preproc/ctags_target_for_gcc_minus_e.cpp"
"/Applications/" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "/var/folders/qf/0kv1rz_w8vl54h006s6kqlvh0000gn/T/arduino_build_77539/preproc/ctags_target_for_gcc_minus_e.cpp"
Compiling sketch...
"/Applications/" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-I/Applications/" "-I/Applications/" "/var/folders/qf/0kv1rz_w8vl54h006s6kqlvh0000gn/T/arduino_build_77539/sketch/Blink.ino.cpp" -o "/var/folders/qf/0kv1rz_w8vl54h006s6kqlvh0000gn/T/arduino_build_77539/sketch/Blink.ino.cpp.o"
Compiling libraries...
Compiling core...
Using precompiled core
Linking everything together...
"/Applications/" -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega328p -o "/var/folders/qf/0kv1rz_w8vl54h006s6kqlvh0000gn/T/arduino_build_77539/Blink.ino.elf" "/var/folders/qf/0kv1rz_w8vl54h006s6kqlvh0000gn/T/arduino_build_77539/sketch/Blink.ino.cpp.o" "/var/folders/qf/0kv1rz_w8vl54h006s6kqlvh0000gn/T/arduino_build_77539/../arduino_cache_794683/core/core_arduino_avr_uno_51f02b7210b938436b779d1c032618e1.a" "-L/var/folders/qf/0kv1rz_w8vl54h006s6kqlvh0000gn/T/arduino_build_77539" -lm
/Applications/ /Applications/ error loading plugin: dlopen(/Applications/, 2): Symbol not found: _environ
Referenced from: /Applications/
Expected in: /usr/lib/libSystem.B.dylib

collect2: error: ld returned 1 exit status
exit status 1
Error compiling for board Arduino/Genuino Uno.

would appreciate any advice

Start by reinstalling the IDE

A bunch of people have had IDE problems, including IDE crashes and bizarre compile errors, when they install a new version of the IDE. At least some of those problems seem to be caused by incompatible executables and preference files that the IDE saves outside the IDE installation directory. Perhaps that is what is causing your particular problem. In such cases it appears that the fix is to delete or rename the old “Arduino15” directory and re-install the new IDE.

On Mac OS X:
/Users/(username)/Library/Arduino15 (a.k.a. ~/Library/Arduino15)
(Note: The ‘Library’ folder is greyed out in Finder. The folder can’t be opened with a double-click. To browse the contents of ‘Library’, ctrl-click on it and select “Open in New Tab” from the pop-up menu.)

On Windows delete or rename both:
Arduino IDE 1.6.5r5 and previous: C:\Users(username)\AppData\Roaming\Arduino15
Arduino IDE 1.6.6 and later: C:\Users(username)\AppData\Local\Arduino15

On Linux:
/home/(username)/.arduino15 (a.k.a. ~/.arduino15)
(Note: file/folder names starting with ‘.’ are not normally shown in directory listings. Use ‘ls -a’ to get a directory listing that includes the hidden files.)

I seem to have solved the issue by installing this experimental version of the Arduino IDE 1.6.1

Arduino is blinking away

Thanks for advice