We are maintaining a java library and the majority of our customers is still using java 8. Since java 8 is getting a bit rusty, we would like to be able to use new language features of newer java versions, say java 17, at compile time, without shutting older customers down. Is there any possibility to achieve this?
To be precise: I only want to use new language features like var
, not new APIs.
How do library-owners usually deal with this?