Southampton police said Wednesday the entertainer had an order of protection against 49-year-old John Dubis of Rhode Island. Information on why the order was obtained wasn't immediately available.
Workers found Dubis on the Water Mill property on August 8 and called police.
He was arraigned the following day on charges of burglary, criminal contempt, stalking and possession of burglar tools. He's due in court Aug. 28.
Dubis is being held on $100,000 bail.
Newsday says the publicist for the singer-actress couldn't be reached for comment and it was unclear whether Dubis had a lawyer.
Lopez bought the 3-acre Water Mill mansion in May.