You can specify the compiler that is used by the servlet_jsp service to compile JSP files of Web applications. You can choose either to use a compiler such as javac (executes in a separate process), or to compile a source file by calling com.sun.tools.javac.Main. To configure the compiler, you can use the Internal Compiler and External Compiler properties of the servlet_jsp service.
Bear in mind that the internal compiler is not supported by the JDK vendors.
1. Start the Config Tool.
2. Choose cluster-data à template à services à servlet_jsp.
3. Choose View → Expert Mode.
4. You can perform the following configuration activities:
If You Want To |
Then |
Compile by calling a method from com.sun.tools.javac.Main |
1. Select the Internal Compiler property and set its value to TRUE. 2. You need to include the tools.jar JDK library (located in the <JDK_directory>\lib directory) to the classpath of your server process. To do this: ○ Go on a template level and choose VM Environment. ○ Select the ClassPath property and edit its value respectively.
If this library is not present in the server classpath, then any attempt of the servlet_jsp service to compile a JSP file (using the com.sun.tools.javac.Main) results to a java.lang.NoClassDefFoundError exception. |
Use a certain Java compiler type |
1. Select the External Compiler property and specify the name of the compiler as a value. By default, the container uses the javac compiler. 2. Also, you need to set the Internal Compiler property to FALSE. |
5. Choose Set to apply the new values.
6. Choose Apply changes to save the configuration.
7. For the changes to take effect, restart the cluster (server).