[root@localhost6 ~]# java --help
Usage: gij [OPTION] ... CLASS [ARGS] ...
to interpret Java bytecodes, or
gij -jar [OPTION] ... JARFILE [ARGS] ...
to execute a jar file
--cp LIST set class path
--classpath LIST set class path
-DVAR=VAL define property VAR with value VAL
-?, --help print this help, then exit
-X print help on supported -X options, then exit
--ms=NUMBER set initial heap size
--mx=NUMBER set maximum heap size
--verbose[:class] print information about class loading
--showversion print version number, then keep going
--version print version number, then exit
Options can be specified with `-' or `--'.
See http://gcc.gnu.org/java/ for information on reporting bugs
[root@localhost6 ~]# gij --version
java version "1.4.2"
gij (GNU libgcj) version 4.1.2 20070626 (Red Hat 4.1.2-14)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
Usage: gij [OPTION] ... CLASS [ARGS] ...
to interpret Java bytecodes, or
gij -jar [OPTION] ... JARFILE [ARGS] ...
to execute a jar file
--cp LIST set class path
--classpath LIST set class path
-DVAR=VAL define property VAR with value VAL
-?, --help print this help, then exit
-X print help on supported -X options, then exit
--ms=NUMBER set initial heap size
--mx=NUMBER set maximum heap size
--verbose[:class] print information about class loading
--showversion print version number, then keep going
--version print version number, then exit
Options can be specified with `-' or `--'.
See http://gcc.gnu.org/java/ for information on reporting bugs
[root@localhost6 ~]# gij --version
java version "1.4.2"
gij (GNU libgcj) version 4.1.2 20070626 (Red Hat 4.1.2-14)
Copyright (C) 2006 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.
以上看到的是操作系统默认的Java环境。
1.到Oracle的官网上下载jdk,执行安装。
2.执行“ln -svf /usr/java/default/bin/java /usr/bin/java”。
3.执行“java -version”查看替换是否已经成功。注意不要使用“java --version”的形式。
http://forums.fedoraforum.org/showthread.php?t=156074