Knowing SHA256(m) and k, is it possible to calculate HMAC-SHA256(k,m)? Cryptographic APIs use to allow for calculating HMAC-SHA256 signatures for message m and key k with something like HMAC-SHA256(k,m). However, I found out that none of them (unless I overlooked it) allows for calculating the MAC from the hash of the message, and key. IOW, the API to calculate HMAC knowing only h=H(m) and k is not available.

For example, Java provides the Mac class, but only allows for a buffer to be fetched so that the output (the HMAC-SHA256) is calculated.

Does this cryptographically makes sense, and if yes, any clue on how to implement this in Java?
No, knowing the SHA-256 hash of an arbitrary message, and a key, it is not possible to compute the HMAC-SHA-256 for that message and key; that's because in HMAC, something dependent on the key is put in front of the message before hashing the message.

Addition: if what's asked was possible, then a break of SHA-256 allowing to find collisions would be a death blow for HMAC-SHA-256 (the HMAC for messages colliding per SHA-256 would be identical for any key). By contrast, we have excellent hope that the HMAC construction would provide enough protection to keep HMAC-SHA-256 practically safe. There's the precedent of HMAC-MD5, which remains unbroken even though MD5's collision resistance is trounced; and the theoretical security argument made by  Mihir Bellare in New Proofs for NMAC and HMAC: Security without Collision-Resistance.



Independently, on the same line: knowing the SHA-256 hash of an arbitrary key of more than 64 bytes, and a message, it is possible to compute the HMAC-SHA-256 for that message and key; that's because by definition of HMAC, for keys larger than the message block size (64 bytes for SHA-256), the first operation made with the key is to replace it by its hash.

Note: in this answer, arbitrary excludes guessing a low-entropy value from its hash.