That's not Java, it's javascript - they are not the same thing and well, your QR code worked perfectly fine here from your file. So a pointless exercise my testing it for you and providing feedback as you seem to have completely ignored my post and it's points.
Good luck.