Shamrock Technologies Inc. will invest $39.6 million to relocate its headquarters from New Jersey to Gray Court.