tags:

views:

428

answers:

5

Hi,

I have been asked to write a java program on linux platform. According to system admin, the JRE on the linux system is GIJ, which is supposed to be compatible to JRE 1.4.2.

java version "1.4.2"
gij (GNU libgcj) version 4.1.2 20080704 (Red Hat 4.1.2-44)
   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.
  1. Is gij stable enough for commercial use?
  2. Should I ask them to install JRE 6.0 from Sun?
  3. What problems should I expect if I target gij?

Currently I am using WinXP, JDK 6.0, and Eclipse for software development.

+1  A: 

gij is the GNU Interpreter for Java, not the Compiler - that's gcj. gcj can compile Java to JVM bytecode (which is interpreted by gij or by any normal Java Virtual Machine) or to native code like a regular compiled language. gij is just the bytecode interpreter, and should probably be equivalent to any other JVM, though I may always be wrong.

Chris Lutz
+1  A: 

GCJ is not equivalent to Sun's JDK or JRE, so you may find that certain things you need aren't included in the API. You also need to compile your code for the GIJ on the server using the GCJ on your development machine. Look in the GCJ libjava directory to see which classes are there. If a class you need isn't there, you can't just copy it over from the Sun JDK; you'll actually need to get them to install the JRE on the server.

Weegee
+3  A: 

gij does OK for Java 1.4 code, but if you're writing something from scratch, there's a good chance you want to use Java 5 and possibly Java 6 features. In particular, Java 5 offers generics, autoboxing/unboxing, and a slew of other helpful language and class library features. The Sun JRE is not onerous at all to install, so unless you're developing a very small app where the Java 5 language features wouldn't help much, or you have some other reason for wanting to stick with 1.4, I would just bite the bullet and install the newest JRE from here.

Matt J
+1 for saying "slew"
skaffman
+4  A: 

gij is very ancient, and while I don't have references I doubt it's reliable enough to support commercial applications. That, and Java 1.4 is a chore to program in.

If your systems administrator is willing to install and support a newer version of Java, it'd probably be best to have them do it.

If the proprietary nature of the Sun JRE concerns you, you should look at OpenJDK. Released under the GPL, it supplants the FSF's efforts with GCJ/GIJ . It's the default version of Java that comes with many open-source Linuxes, such as Debian, Ubuntu, and Fedora. Besides being free, it's also modern---OpenJRE 6 is fully compatible with Sun's JRE6.

Samat Jain
+1. But OpenJDK's MetalLookAndFeel is slightly off (compared to Suns).
KitsuneYMG
+2  A: 

gij hasn't passed the Sun compatability test, and should be considered a separate platform for building, testing etc.

If you don't want to go there, then install either the Sun JVM (it is just a matter of typing "apt-get install sun-java6-jdk" and accept the license) or OpenJDK (which has a more liberal license, but is not at rigidly tested).

Thorbjørn Ravn Andersen
+1 for truth. the gij/gcj project is trash wrt implementing java. Never use it.
KitsuneYMG
Not correct. The major hurdle is that Sun does not want to license the TCK to open source projects not derived substantionally from OpenJDK. This means that there are rough corners that need to be found before they can be fixed, as they cannot be caught by the TCK.
Thorbjørn Ravn Andersen