Could you say "я маю сім років", or are "years" something you cannot posses, indicated by verb "маю"?
Is there something wrong with "у мене сім років"?
мені сім (років) is the only way to express that.
Мене is genitive, мені is dative. In this phrase, dative has to be used.
You could say "У мене сім котів" because cats are something you can possess. Years are not, at least not in the same way. Perhaps this could be argued, but ultimately, it's just idiomatic!