It's both, and it boggles my mind how so many can (claim to) be so deluded as to say it's entirely the latter. Notably, their culture has changed dramatically over the last ~300 years (as it has for most nations), yet one wouldn't claim they are no longer Japanese on that basis.
And the Japanese themselves consider Japanese-ness genetic, so who are you to tell them otherwise?