Japan had hottest June on record: weather agency