You also need to provide the path to the jikes executable as an init-param
for the JspServlet, eg:

<init-param>
  <param-name>jspCompilerPath</param-name>
  <param-value>c:\jikes\bin\jikes.exe</param-value>
</init-param>

However, I've still had problems with the Jikes plug-in when using Windows,
as the startup.bat script forces jikes to use the standard CLASSPATH instead
of JIKESPATH environment variables.  This is important as with CLASSPATH,
you don't need to specify where "rt.jar" is (that's the archive containing
java.lang, java.util, etc.), whereas JIKESPATH contains the CLASSPATH info
plus all of the other essential classes for Jikes (as Jikes make any
assumptions about which JDK to use).

You can work around this by modifying startup.bat, but it's a shame there
isn't a "-jikes" parameters for the startup script with the standard
distribution.

Other than that, I've also looked at the source code (for Tomcat 3.2.2) for
the various JSP compilation classes ; Tomcat forces all compilers to use
UTF8 encoding, which provokes havoc with ISO-8859-1 or UTF16 encodings
(i.e.: you get nothing but garbage in some cases, in other cases, Tomcat
sends uncompiled source code!!!).

No one seems interested by the above points however, which is a great shame.
I've already posted about these subjects... check out the archives...

-Chris


----- Original Message -----
From: "Gautam Sinha" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, July 19, 2001 4:21 AM
Subject: Replacing tools.jar with Jikes for JSP compilation


> This seems to be a popular question.  There have been some excellent
> postings before to solve the dilemma, and some of them involved modifying
> the tomcat source code.
>
> Here are the steps for replacing tools.jar with Jikes for Tomcat 3.2.1 on
> the Windows 2000 platform, without modifying the source code for Tomcat.
>
> 1. Download jikes.  It is currently available from
> http://oss.software.ibm.com/developerworks/opensource/jikes/ under the IBM
> Open License.
> 2. Add the path to the jikes.exe executable to the system PATH variable.
> 3. Assuming you already have the JRE (Java Runtime Environment) available,
> add rt.jar to the Java classpath variable (usually found in
> JAVA_HOME/jre/lib).
> 4. Paste the following code anywhere between the <web-app> and </web-app>
> tags of the web.xml file contained in the WEB-INF directory of your web
> application (not the web.xml in tomcat_home/conf).  If you don't have a
> web.xml for your application, you can create one by putting the following
> code between <web-app> and </web-app> tags and placing it in the WEB-INF
> directory of your application context.
>
>   <!-- Using jikes java compiler for JSP -->
>     <servlet>
>       <servlet-name>
>           jsp
>       </servlet-name>
>
>       <servlet-class>
>           org.apache.jasper.servlet.JspServlet
>       </servlet-class>
>
>       <init-param>
>           <param-name>jspCompilerPlugin</param-name>
>
> <param-value>org.apache.jasper.compiler.JikesJavaCompiler</param-value>
>       </init-param>
>
>       <load-on-startup>
>           -2147483646
>       </load-on-startup>
>     </servlet>
>
>   <!-- Mapping jsp pages to the jsp servlet -->
>     <servlet-mapping>
>       <servlet-name>
>           jsp
>       </servlet-name>
>       <url-pattern>
>           *.jsp
>       </url-pattern>
>     </servlet-mapping>
>
> (It is important to clean out precompiled JSP files in Tomcat's work
> directory and to search throughout the local hard drives for copies of
> tools.jar and temporarily rename them before you can establish that jikes
is
> indeed being used to compile the JSP).
>
> Troubleshooting:
>
> 1. It is safe to ignore the message(s) of the following format:  Ctx():
> Removing duplicate servlet jsp
> jsp(org.apache.jasper.servlet.JspServlet/null)
> 2. If you get a message like "Location: /myapp/edituser.jsp -- Internal
> Servlet Error: -- org.apache.jasper.JasperException: Unable to compile
class
> for JSP at org.apache.jasper.compiler.Compiler.compile(Compiler.java:254)"
> followed by a stack trace, most likely the system did not find "jikes.exe"
> in its search path.
> 3. If you get a message like "Location: /myapp/edituser.jsp -- Internal
> Servlet Error: -- org.apache.jasper.JasperException: Unable to compile
class
> for JSP -- Found 2 system errors: -- *** Error: Could not find package
> "java/util" in:" followed by a list of paths, most likely the system did
not
> find "rt.jar" in its classpath.  "java/util" and "java/lang" are read from
> "rt.jar".
>
>
> Good luck!
>
>

Reply via email to