[hadoop@djtNode3 ~]$ java
Usage: gij [OPTION] ... CLASS [ARGS] ...
to invoke CLASS.main, or
gij -jar [OPTION] ... JARFILE [ARGS] ...
to execute a jar file
Try `gij --help' for more information.
[hadoop@djtNode3 ~]$ java -version
java version "1.5.0"
gij (GNU libgcj) version 4.4.7 20120313 (Red Hat 4.4.7-16)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
该问题解决方法:
在root用户下,指定你要安装的jdk位置,比如我的是/home/hadoop/lib/jdk1.8.0_91下:
[root@djtNode2 ~]# alternatives --install /usr/bin/java java /home/hadoop/lib/jdk1.8.0_91/bin/java 300
然后:
[root@djtNode2 ~]# alternatives --config java
There are 2 programs which provide 'java'.
Selection Command
-----------------------------------------------
*+ 1 /usr/lib/jvm/jre-1.5.0-gcj/bin/java
2 /home/hadoop/lib/jdk1.8.0_91/bin/java
Enter to keep the current selection[+], or type selection number: 2
这样就可以更改原本你jdk的指向错误。