My build from tomcat trunk stopped working a little while ago with the error: build/build.xml:675: javac doesn't support the "release" attribute Originally I though the problem was that I need the latest version of ant so I upgraded to ant 1.10.5 . The problem however persisted. This leads me to the conclusion that the problem is that the ant scripts now actually require a minimum of jdk 9 as they are passing the -release flag to javac. It was my understanding that tomcat 8 could be built with java 7 onwards.
I actually just got that same error a couple of hours ago building 9.0.13-dev using Java 1.8.0_172 and Ant 1.9.7 on Windows. I upgraded to ant 1.10.5 and it solved the issue for me. Are you sure that the correct version of Ant is on the path? Can you confirm by running the command: ant -version ?
I just built again with Java 1.8.0_181 and Ant 1.10.5 on Fedora 28 with no issue. Ant output shows that the --release switch is ignored on a sub-9 Java version: [javac] Support for javac --release has been added in Java9 ignoring it
> build/build.xml:675: javac doesn't support the "release" attribute The above message means that the "javac" task of Ant does not know the "release" attribute, cannot process the build file. Support for "release" attribute was added in Ant 1.9.8 and 1.10.0. The required minimum version of Ant is documented in BUILDING.txt file of Tomcat. The official release of Tomcat 8.5.34 was built with Ant 1.9.9 and JDK 7u80, as can be seen in MANIFEST.MF files in jars. The release of Tomcat 9.0.12 was built with Ant 1.9.9 and JDK 8u181.
apologies, looks like ti was a path issue. I've re-ran the code and yes it does compile with ant 1.10.5 and jdk 8. So closing this one out.
Just for others. The problem was that I had hand installed ant into my user account but when the build tools ran they ran as sudo which didn't have the ant environment vars pointing at the wrong version.
We should probably check the version of Ant used and stop the build with an explicit error message.
(In reply to Emmanuel Bourg from comment #6) > We should probably check the version of Ant used and stop the build with an > explicit error message. I can add that.
Descriptive error added in commit r1840783 if running Ant version is older than the minimum required 1.9.8
(In reply to Igal Sapir from comment #8) > Descriptive error added in commit r1840783 if running Ant version is older > than the minimum required 1.9.8 Simplified check in commit r1840784
(In reply to Brett Sutton from comment #5) > [W]hen [my] build tools ran they ran as sudo Do you mean root? Or just sudo-to-other-user? You should never have to build Tomcat as root. Since I'm mentioning it, you should never run Tomcat as root, either.