I ran namenode -format.This is my output. I tried changing the file permissions chmod 777 hadoop.
I believe this line is the error ERROR namenode.NameNode: java.io
This is a permissions issue. Either you can use 1. sudo 2. login as root
But the best solution is
sudo chown $HADOOP_HOME
hadoop namenode -format
Where HADOOP_HOME is your hadoop installation directory