https://issues.apache.org/bugzilla/show_bug.cgi?id=54461

--- Comment #5 from Nick Williams <nicho...@nicholaswilliams.net> ---
That's unrelated to the documentation I reported. I mentioned that I was trying
to compile with Java 8 for context, but I suppose that could have just made it
more confusing.

It boils down to this: I wanted to compile JSPs with Java 8. I knew that Tomcat
uses the Eclipse JDT compiler for JSP compilation, and I knew that the Eclipse
JDT compiler did NOT support "1.8" yet, so I was expecting the warning that it
was ignoring "1.8." However, the documentation on the "compiler" parameter
vaguely eluded to the capability of using something other than the JDT
compiler, but, following that documentation, I was having a very hard time
getting it to work. Everything I tried to set the "compiler" variable to, I
still got the warning from Eclipse.

I found a forum/list posting through Google
(http://grokbase.com/t/tomcat/users/07685hc9k7/using-javac-instead-of-jdt-to-compile-jsps)
that confused and misled me into thinking that the documentation was correct
and that it should be "compilerClassName," not "compiler" (and what led me to
file this bug, prematurely). But when I tried to set it to
com.sun.tools.javac.Main as suggested in the forum, it couldn't be casted.
That's how I discovered the JDTCompiler and AntCompiler classes and came to the
mistaken conclusion that you had to set the compilerClassName parameter to the
AntCompiler class AND set the compiler parameter to "modern" to achieve what I
wanted to.

However, when I started getting errors from the compiler that were related to
my lambda expression in my JSP, I (again, incorrectly) made the assumption that
the Ant compiler wasn't using the the JDK compiler like I thought it would and
that Ant didn't support Java 8. In actuality, my new problem was related to a
bug with SMAPs and Java 8, and I had to add suppressSmap = true to my JSP
configuration.

So, what all of that comes down to is, the SMAP issue needs to be fixed (I will
file a separate issue for that) and the documentation could use some
improvement. Currently it says:

compiler - Which compiler Ant should use to compile JSP pages. See the Ant
documentation for more information. If the value is not set, then the default
Eclipse JDT Java compiler will be used instead of using Ant. No default value.

Violeta changed it do:

compiler - Which compiler Ant should use to compile JSP pages. See the <a
href="http://ant.apache.org/manual/Tasks/javac.html";>Ant documentation</a> for
more information. If the value is not set, then the default Eclipse JDT Java
compiler will be used instead of using Ant. No default value.

I would recommend (A) adding documentation for the compilerClassName and
explaining why it would need to be used, and (B) changing the compiler
documentation to:

compiler - Setting this parameter automatically enables the Ant compiler
instead of the Eclipse JDT compiler. The value specified indicates which
compiler Ant should use to compile JSP pages. See the <a
href="http://ant.apache.org/manual/Tasks/javac.html#compilervalues";>Ant
documentation</a> for the list of valid values for this parameter, which
corresponds to the compiler attribute on the Ant Javac task. If the value is
not set, then the default Eclipse JDT Java compiler will be used instead of
using Ant. No default value. The JDK's tools.jar and Ant's ant.jar and
ant-launcher.jar must be on Tomcat's classpath in order for this setting to
work.

I think that explains it well, and should prevent any further confusion from
tired people like me. :-)

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to