How to change tomcat compiler

后端 未结 5 1442
醉酒成梦
醉酒成梦 2020-12-10 03:03

I\'m trying to use the new Java 7 switch on strings feature.

But Tomcat is not cooperating.

I\'ve made sure that tomcat is running under java 7 but it seems

5条回答
  •  时光取名叫无心
    2020-12-10 03:43

    Your mixing something here. You want your JSPs compile with Java 7 and not have the tomcat run with Java 7. Tomcat uses the Eclipse Java Compiler which is does not have Java 7 support yet.

    Edit: I did some digging. As you can see here, the built-in Eclipse compiler is used. The compiler distributed with Tomcat 7.0.19 is ECJ 3.7 which will support Java 7 not before 3.7.1.

提交回复
热议问题