Prerequisities: a Sun JDK version 1.5.0_14 or later for JDK 5, or version 1.6.0_03 or later for JDK 6. Note that if you plan to deploy any applications that include Java code that is compiled by the web UI (such as POJO services or EIPs with embedded Java code), you must use JDK 5. See this issue for more information.
See here for instructions on installing the Fuji GlassFish runtime