An example of how to add Ehcache to a Spring project as a Spring caching abstractions.
I chose Java configuration or you were on a new project, then you would use Spring Boot, like https://spring.io/blog/2015/06/15/cache-auto-configuration-in-spring-boot-1-3
The associated blog entry is at http://javaninja.net/2016/02/spring-ehcache/