1 | |
---|
2 | How to configure Tomcat to use Java 1.5 |
---|
3 | ======================================= |
---|
4 | |
---|
5 | The new Tomcat 5.5 comes with it's own compiler, which is not |
---|
6 | Java 1.5 compatible. Here are the instructions to replace the |
---|
7 | built-in compiler with Sun's compiler. |
---|
8 | |
---|
9 | It requires that you have downloaded and installed Java 1.5 SDK |
---|
10 | and Ant. |
---|
11 | |
---|
12 | * Copy "tools.jar" from JAVA_HOME/lib to TOMCAT_HOME/common/lib |
---|
13 | |
---|
14 | * Copy "ant.jar" from ANT_HOME/lib to TOMCAT_HOME/common/lib |
---|
15 | |
---|
16 | * Remove "jasper-compiler-jdt.jar" from TOMCAT_HOME/common/lib |
---|
17 | |
---|
18 | * Open the file "TOMCAT_HOME/conf/web.xml" and locate the place |
---|
19 | that says: |
---|
20 | |
---|
21 | <servlet> |
---|
22 | <servlet-name>jsp</servlet-name> |
---|
23 | <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class> |
---|
24 | <init-param> |
---|
25 | <param-name>fork</param-name> |
---|
26 | <param-value>false</param-value> |
---|
27 | </init-param> |
---|
28 | <init-param> |
---|
29 | <param-name>xpoweredBy</param-name> |
---|
30 | <param-value>false</param-value> |
---|
31 | </init-param> |
---|
32 | <load-on-startup>3</load-on-startup> |
---|
33 | </servlet> |
---|
34 | |
---|
35 | Add two new <init-param> tags: |
---|
36 | |
---|
37 | <init-param> |
---|
38 | <param-name>compilerSourceVM</param-name> |
---|
39 | <param-value>1.5</param-value> |
---|
40 | </init-param> |
---|
41 | <init-param> |
---|
42 | <param-name>compilerTargetVM</param-name> |
---|
43 | <param-value>1.5</param-value> |
---|
44 | </init-param> |
---|
45 | |
---|
46 | Restart the Tomcat web server. Everything should now work. |
---|
47 | |
---|
48 | More information can be found on (this very ugly URL): |
---|
49 | http://blog.taragana.com/index.php/archive/how-to-run-javac-15-or-beyond-compiler-for-jsp-compilation-in-tomcat-55-with-generics-enabled-and-other-15-only-features/ |
---|
50 | |
---|
51 | |
---|