This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.

jdk 1.5 and AppleScriptEngine.jar error?

Feb 24th, 2011, 08:19 AM

From time to time I get this strange error message when I create a new maven project in STS:

Incompatible .class files version in required binaries. Project 'web_flow_mvc' is targeting a 1.5 runtime, but is compiled against 'System/Library/Java/Extensions/AppleScriptEngine.jar' (from the container 'JRE System Library [J2SE-1.5]') which requires a 1.6 runtime

It has been suggested elsewhere to move this jar from the jdk indicating Apple did something stupid with jdk5, but clearly I don't have this problem in every project– like in Spring Roo projects – so why does it creep up in the first place?

I tried to make STS ignore just this jar, but that doesn't seem possible as it's in the jdk. Can use some kind of filter mechanism to enforce STS to ignore this unnecessary jar?
Or, even better, how do I set up my maven projects so this problem doesn't occur?

Out of the blue this problem started to occur also in Roo-created projects, unlike before. I tried to follow the suggestions made at the objectstyle.org WIKI, but as the option to remove any content belonging to the jdk was grayed out I moved the AppleScriptEngine.jar out of my jdk instead. Problem gone.

I would have prefer to keep my jdk intact even as Apple seems to have made a mistake with their latest jdk5.

Anyone know of how to enable editing of the contents of the jdk in use within STS/Eclipse?