simple: You don't write all of your experience in your resume, only the experience relevant to the job you apply for. They want 5-7 years experience in Java? List only your last two Java jobs, don't mention that you did 15 years of C++ before that.
Regardless, it still doesn't solve the problem for foreigners who may have only worked for companies outside the US.