Sunday, March 25, 2007

Java Programming in Linux (CentOS) gcj - Part 1

If you installed CentOS in custom by selecting "everything" or "full" then you got java in development tools. But this java is not the same as SUN Java (j2sdk/jdk/jre). But an open source java runtime and an open source java compiler.
[root@localhost programming]# rpm -qa | grep java
gcc-java-3.4.5-2
gcc4-java-4.0.2-14.EL4
java-1.4.2-gcj-compat-1.4.2.0-27jpp
db4-java-4.2.52-7.1
java-1.4.2-gcj-compat-devel-1.4.2.0-27jpp


Ok so it is gcj so what the heck is gcj?
[root@localhost programming]# java -version
java version "1.4.2"
gcj (GCC) 3.4.5 20051201 (Red Hat 3.4.5-2)
Copyright (C) 2004 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.


If you have programmed in java on windows and new to linux you can understand something after reading the above lines. So what about the java compiler?
[root@localhost programming]# javac -version
Eclipse Java Compiler 0.319_R21x, Copyright IBM Corp 2000-2003. All rights reserved.

We got java runtime and java compiler installed for us.

No comments: