Tomcat and JSP: "Unable to compile class for JSP": A Solution

I received the following error on Tomcat 4.1.24 and Websphere Application Developer (WSAD) 5.0 using Domino 6.0.1 on WinXP:

org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: -1 in the jsp file: null

Generated servlet error:

[javac] Since fork is true, ignoring compiler setting.

[javac] Compiling 1 source file

[javac] Since fork is true, ignoring compiler setting.

The solution aluded me until I googled this and found that the JAVA_HOME is the culprit. It appears that this does not happen on 4.1.18 (although I did not try this version). Instead, if you run into this one, do the following:

  1. In WSAD, go to the Server Configuration View. Open “Tomcat 4.1 Local Server”. The configuration will show you the JAVA_HOME setting.

  2. Set this setting to "C:\Program Files\Java\j2sdk1.4.1_02\jre" or your equivalent directory. NOTE: it is looking for the JVM.DLL in the SDK (not the normal J2RE directory).

  3. Make sure to reset this in my Environmental Variables also. (There is a JAVA_HOME there as well.) Find this in your control panel, System, Advanced tab (button at the bottom). MS is always moving this.

  4. Restart your Tomcat server.

Works fine now!

Hope this saves you some time.

M.