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

--- Comment #3 from Nick Williams <nicho...@nicholaswilliams.net> ---
I tried the following variations of the compiler init parameter:

        <init-param>
            <param-name>compiler</param-name>
            <param-value>classic</param-value>
        </init-param>

        <init-param>
            <param-name>compiler</param-name>
            <param-value>modern</param-value>
        </init-param>

        <init-param>
            <param-name>compiler</param-name>
            <param-value>jikes</param-value>
        </init-param>

        <init-param>
            <param-name>compiler</param-name>
            <param-value>extJavac</param-value>
        </init-param>

And with each one, I simply got these warnings whenever the first JSP tried to
compile:

Jan 22, 2013 3:37:59 PM org.apache.jasper.compiler.JDTCompiler generateClass
WARNING: Unknown source VM 1.8 ignored.
Jan 22, 2013 3:37:59 PM org.apache.jasper.compiler.JDTCompiler generateClass
WARNING: Unknown target VM 1.8 ignored.

It continued to use the Eclipse compiler. It occurred to me that maybe the
"compiler" init parameter does not work without the "compilerClassName"
parameter, and it appears that is correct.

        <init-param>
            <param-name>compilerClassName</param-name>
            <param-value>org.apache.jasper.compiler.AntCompiler</param-value>
        </init-param>
        <init-param>
            <param-name>compiler</param-name>
            <param-value>jikes</param-value>
        </init-param>

That (as expected) produces an error that the jikes compiler could not be
started (since I don't have the jikes compiler). Before I added in the
compilerClassName, it never even tried to use the jikes compiler.

I also tried the "classic," "modern" and "extJavac," and while it's no longer
trying to use the Eclipse compiler, it appears there are no options for using
the JDK's javac compiler, as I get errors for each of these options that the
lambda expression in my JSP is not valid syntax, despite the fact that the same
lambda expression compiles in a class compiled by my JDK. This is, I suppose, a
different issue.

As for the documentation bug, your change helps, but I believe it could be
improved further:

1) "compilerClassName" is not documented at all. It NEEDS to be document,
especially since "compiler" doesn't work unless you set "compilerClassName" to
the AntCompiler class.

2) This is how I suggest wording the change you already made to "compile":

See the <a
href="http://ant.apache.org/manual/Tasks/javac.html#compilervalues";>Ant
documentation</a> for more information. This value corresponds to the
"compiler" attribute of the Javac Ant task, and all Ant-supported values are
legal here. Parameter "compilerClassName" must be set to the AntCompiler class.
If "compilerClassName" is not set to the AntCompiler class, this parameter is
ignored and the Eclipse JDT Java compiler will be used instead of using Ant. If
"compilerClassName" is set to the AntCompiler class but this parameter is not
set, then the default Ant compiler will be used.

-- 
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