Spring/Java error: namespace element 'annotation-config' … on JDK 1.5 and higher

后端 未结 11 1178
Happy的楠姐
Happy的楠姐 2020-11-29 00:47

I have Spring/Java App that is compiled with Compiler compliance level 1.5.

I have a new Linux setup where I downloaded Apache Tomcat 8.0.8<

11条回答
  •  南方客
    南方客 (楼主)
    2020-11-29 01:27

    I happen to be another unfortunate user of a very old project (developed in 2008!) which is still using Spring 2.5. And it is not a Maven project either, so upgrading to later versions of Spring was taking a long time with dependencies failing and giving build errors. I downgraded tomcat JRE to 1.7 and it worked fine.

    Just documenting how to do that in eclipse in case someone needs help:

    1. If you do not already have Java 7, download JDK 7 and install it somewhere like C:\Program Files\Java\jdk1.7.0_71

    2. Then go to eclipse and double click on Servers > Tomcat vX.Y server

    3. Click on Runtime Environment, then Installed JREs

    4. Then Add > Standard VM and click Next. You see a window like this:

      Adding a new JRE

    5. Click on Directory... and browse to the folder where you installed the JDK (i.e. C:\Program Files\Java\jdk1.7.0_71. JDK is fine, no need for JRE). Click Finish.

    6. Then make sure to select the JRE for Java 7 and you are all set.

提交回复
热议问题