2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2020

10/31/2006: Embedded Tomcat; Fixing the 'No Java Compiler available' error.

I am investigating the use of embedded Tomcat in one of my projects. During my testing, I ran into an error message:

No Java compiler available

I was unable to find significant information about this message via Google so I downloaded the Tomcat source and poked around. To make a short story shorter, include the following jar files to fix this issue:

TOMCAT_HOME\common\lib\jasper-compiler.jar
TOMCAT_HOME\common\lib\jasper-compiler-jdt.jar

10/31/2006: Fixing the "No Java compiler available" Error When Running Embedded Tomcat

I created an Eclipse project which runs an embedded version of Tomcat. More about that in a future post. I ran into the following message when I tried to serve a JSP page: java.lang.IllegalStateException: No Java compiler available

I downloaded the Tomcat source (gotta love open source!) and found the following lines of code:

  jspCompiler = null;
  if (options.getCompiler() == null) {
    jspCompiler = createCompiler("org.apache.jasper.compiler.JDTCompiler");
    if (jspCompiler == null) {
      jspCompiler = createCompiler("org.apache.jasper.compiler.AntCompiler");
    }
  }

I did a little digging and found that several jar files where not in my classpath:

jasper-compiler.jar jasper-compiler-jdt.jar