can we change the path of java installed folder?how?

3.7k views Asked by At

I am learning Hadoop. On my windows system java is installed at C:/Program files/Java , but the problem is, I believe the white space in program files.

After setting all hadoop configuration files, When I run the command namenode format it give the following error.

$ bin/hadoop namenode -format bin/hadoop: line 350: C:\Program
Files\Java\jdk1.7.0_71/bin/java: No such file or directory

So is there any way by which i can change the java folder location to C:/Java from C:/Program files/Java

Thanks.

2

There are 2 answers

0
akshay naidu On BEST ANSWER

copy pasting the java folder to C:/Java from C:/Program files/Java and updating the environment variables with new path worked for me

1
Loic Mouchard On

If you do not want to move your java installation, you can try following possibilities:

  1. set your java path within quotation
  2. use the ~ operand -> your path is then C:\Program~1\Java\jdk1.7.0_71