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

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


subscribe via RSS