This paper makes the case why mobile code is an appropriate solution for platforms running on mobile devices aggregated in mobile ad hoc networks. It also presents a solution that considers the introduction of mobile code using remote class loading in the J2ME/CLDC profile. The principal problem of remote class loading revolves around trusting the remote code in accessing system resources. After a review of the algorithms which are used to accomplish access control, a mechanism for the CLDC is proposed that is based on the history of the access control.