Openjdk vs android api

What difference is there between openjdk and android api? If I’m not running the emulator, just a gradle lint test, should I use openjdk instead?

The docs once had it in an example for android. Otherwise, is it possible to run a lint test using openjdk?