How to enable Eclipse's JDT Compiler for JSP compilations in GlassFish
By jluehe on Jul 11, 2006
How to enable Eclipse's JDT Compiler for JSP compilations in GlassFishA repeated request heard on the GlassFish developer forums has been the ability to use the Eclipse Java Development Tools (JDT) Compiler (instead of the javac from Sun's SDK) for JSP compilations.
The Eclipse JDT Compiler is used as the default compiler in Tomcat 5.5, and included with Tomcat's binary distribution.
This blog lists the steps required to use the JDT Compiler for JSP compilataions in GlassFish. Starting with the upcoming GlassFish Promoted Build v2 10 (which will be available from the GlassFish download page), it will be possible to enable the JDT compiler from Eclipse for JSP compilations in GlassFish, by adding the following two JAR files to your
jasper-compiler-jdt.jar: This JAR file has been taken unmodified from a Tomcat 5.5 binary distribution.
jasper-compiler-jdt-ext.jar: This JAR file contains a version of Tomcat's
org.apache.jasper.compiler.JDTCompilerwhich has been recompiled against the
This recompilation step has been necessary because Tomcat's
org.apache.jasper.compiler.Compilerand accesses the
loginstance variable of its superclass. Notice that while the type of the
loginstance variable in Tomcat is
org.apache.commons.logging.Log, it was changed to
com.sun.org.apache.commons.logging.Login GlassFish, for the reasons explained here.
Notice that when using the default ant/javac based compiler in GlassFish, the
fork initialization parameter of the
org.apache.jasper.servlet.JspServlet defined in your domain's
default-web.xml is used to specify whether javac compilations are to be performed in process or forked to a separate process. By default,
fork is set to TRUE, to avoid memory leak and file locking problems that have been observed with javac. The
fork init parameter is ignored by the JDTCompiler, which always runs in process.