This may be dependency management and/or IDE issue. I'm regularly seeing similar issues while having many projects open in IntelliJ IDE that have different versions of Java and dependencies. Closing IDE and opening with single project usually resolves this.