Is it possible to determine consumer Java version in library?

Looks like this other thread has the right answer: adding a feature variant is done by adding a capability.

See that other thread for more information.