[last updated 15-mar-2003] First, you must have Java 1.4.1 installed. Earlier will reputedly Not Work. Get it from http://java.sun.com/j2se/1.4.1/download.html You want the SDK, but probably not the Forte/SDK. On RedHat boxen, just download the rpm option which will give you a file named 'j2sdk-1_4_1_02-linux-i586-rpm.bin'. You need to run this to get the actual RPM. Yes, this is a security hole, Sun should know better, don't do this as root: chmod u+x j2sdk-1_4_1_02-linux-i586-rpm.bin ./j2sdk-1_4_1_02-linux-i586-rpm.bin You have to read their license and type 'yes'. Now you have a file called 'j2sdk-1_4_1_02-fcs-linux-i586.rpm'. Become root and install with rpm -Uvh j2sdk-1_4_1_02-fcs-linux-i586.rpm On Debian boxes, I find it easiest to download the .tgz and unpack it in your home directory. Download the "Linux self-extracting file" option to get a file named 'j2sdk-1_4_1_02-linux-i586.bin'. Then: chmod u+x j2sdk-1_4_1_02-linux-i586.bin ./j2sdk-1_4_1_02-linux-i586.bin This will create a directory called 'j2sdk1.4.1_02' in the current working directory. To download the GJ prototype compiler, go to: http://developer.java.sun.com/developer/earlyAccess/adding_generics Log in as 'fredastaire' password 'tapdance' Unpacking the download will create a directory 'jsr14_adding_generics-1_3-ea' Now we're just going to follow the directions which jsr14_adding_generics-1_3-ea/README give for getting scripts/javac to work: ...[Y]ou will need to set two environment variables. JSR14DISTR should point to where you have unpacked this distribution. J2SE14 should point to your installation of version 1.4.1 or later of the Java(TM) 2 SDK, Standard Edition. So do that. On my debian machine I have the following lines in ~/.bashrc: export J2SE14=$HOME/j2sdk1.4.1_02 export JSR14DISTR=$HOME/jsr14_adding_generics-1_3-ea export PATH=$J2SE14/bin:$PATH You won't need the 'export PATH' on a RedHat box with the .rpm script, and your paths will probably look something like: export J2SE14=/usr/java/j2sdk1.4.1_02/ export JSR14DISTR=$HOME/jsr14_adding_generics-1_3-ea If your shell is csh or tcsh (look for these in the output of 'ps'), then you change the 'export' to 'setenv' and replace the '=' with a space. Instead of ~/.bashrc, you'd want to modify ~/.cshrc. And that's it! The FLEX makefile will automatically detect the presence of $JSE14DISTR/scripts/javac and Do The Right Thing now. We currently compile the classes listed in 'gj-files' with the GJ compiler and the rest of the classes with the standard JDK 1.4.1 compiler. This is because 14 files in FLEX still trigger bugs in the GJ compiler. As soon as these bugs are fixed, we'll probably move to an all-GJ compilation process. If you GJ-ize your code, all you have to do is add it to gj-files to make sure the GJ compiler, and not the standard java compiler, is used to build it. GJ and non-GJ code is quite interoperable, though; you might want to refer to the GJ spec for more details on how that is accomplished. If you GJ-ize a base class that is needed by non-GJ code, please 'make Support/gjlib.jar' and check in this file, so as not to break the build for non-GJ-using folk. For future reference, here are some important GJ sites: JSR14 -- official GJ spec: http://www.jcp.org/jsr/detail/14.jsp "Adding Generics" forum -- the GJ developers answer questions here sometimes: http://forum.java.sun.com/forum.jsp?forum=316 Prototype compiler: http://developer.java.sun.com/developer/earlyAccess/adding_generics Original GJ home page; superceded by the JSR14 spec, but contains more easily-readable documents on the language and its design. http://www.cis.unisa.edu.au/~pizza/gj/