/usr/bin/java is executable, which is basically a link to /etc/alternates/java. /etc/alternates should be another link to another location, you can verify with ls -alrt /etc/alternates it is the JRE came with your installation.
On Wed, Jun 3, 2015 at 3:02 PM, Kadir Beyazlı <[email protected]> wrote: > But I firtslt tried to find where my java with follwing command : > > > *kadir@kbeyaz:~/hadoop-2.7.0$ which java/usr/bin/java* > > Then I set JAVA_HOME to */usr/bin/java* and edited etc/hadoop-env.sh > I did not write* /usr/bin/java/bin/java* it and I am trying to understand > how it found that path while trying to apply following command which is > hadoop site*:* > > $ bin/hadoop jar share/hadoop/mapreduce/hadoop-mapreduce-examples-2.7.0.jar > grep input output 'dfs[a-z.]+' > > Now I changed JAVA_HOME, this time it gives follwing error, adding /bin/java > to path again > > bin/hadoop: line 171: exec: /etc/alternatives/java/bin/java: cannot execute: > Not a directory > > > > > > On Wed, Jun 3, 2015 at 10:49 PM, Ilker Ozkaymak <[email protected]> > wrote: > >> So your actual java_home is under /etc/alternatives it is not >> /usr/bin/java/bin/java >> second path doesn't exists that is why it is erroring... >> Please verify your java home and try again with correct path... >> >> On Wed, Jun 3, 2015 at 2:46 PM, Kadir Beyazlı <[email protected]> >> wrote: >> >>> Hi, >>> >>> kadir@kbeyaz:~/hadoop-2.7.0$ ls -arlt /usr/bin/java >>> lrwxrwxrwx 1 root root 22 Oca 27 11:42 /usr/bin/java -> >>> /etc/alternatives/java >>> >>> Also; >>> >>> kadir@kbeyaz:~/hadoop-2.7.0$ java -version >>> openjdk version "1.8.0_40-internal" >>> OpenJDK Runtime Environment (build 1.8.0_40-internal-b09) >>> OpenJDK 64-Bit Server VM (build 25.40-b13, mixed mode) >>> >>> >>> On Wed, Jun 3, 2015 at 10:42 PM, Ilker Ozkaymak <[email protected]> >>> wrote: >>> >>>> please do >>>> ls -arlt /usr/bin/java >>>> >>>> On Wed, Jun 3, 2015 at 2:40 PM, Kadir Beyazlı <[email protected]> >>>> wrote: >>>> >>>>> Hi, >>>>> >>>>> Also >>>>> >>>>> kadir@kbeyaz:~/hadoop-2.7.0$ which java >>>>> /usr/bin/java >>>>> >>>>> >>>>> On Wed, Jun 3, 2015 at 10:39 PM, Kadir Beyazlı <[email protected] >>>>> > wrote: >>>>> >>>>>> Hi Ilker, >>>>>> >>>>>> kadir@kbeyaz:~/hadoop-2.7.0$ /usr/bin/java/bin/java -version >>>>>> bash: /usr/bin/java/bin/java: Not a directory >>>>>> kadir@kbeyaz:~/hadoop-2.7.0$ ls -arlt /usr/bin/java/bin/java >>>>>> ls: cannot access /usr/bin/java/bin/java: Not a directory >>>>>> >>>>>> >>>>>> On Wed, Jun 3, 2015 at 10:35 PM, Ilker Ozkaymak <[email protected]> >>>>>> wrote: >>>>>> >>>>>>> One more question would you please run >>>>>>> /usr/bin/java/bin/java -version >>>>>>> and >>>>>>> ls -arlt /usr/bin/java/bin/java >>>>>>> >>>>>>> >>>>>>> On Wed, Jun 3, 2015 at 2:31 PM, Kadir Beyazlı < >>>>>>> [email protected]> wrote: >>>>>>> >>>>>>>> ked all variables at line 171, all of t >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> >>>>>> *Kadir BeyazlıComputer Engineer* >>>>>> *GSM : +90 535 821 50 00 <%2B90%20535%20821%2050%2000>* >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> >>>>> *Kadir BeyazlıComputer Engineer* >>>>> *GSM : +90 535 821 50 00 <%2B90%20535%20821%2050%2000>* >>>>> >>>> >>>> >>> >>> >>> -- >>> >>> *Kadir BeyazlıComputer Engineer* >>> *GSM : +90 535 821 50 00 <%2B90%20535%20821%2050%2000>* >>> >> >> > > > -- > > *Kadir BeyazlıComputer Engineer* > *GSM : +90 535 821 50 00 <%2B90%20535%20821%2050%2000>* >
