With wide and increasing range applications of mobile agent technology, the security problem has gottenmore and more focus. This paper discusses the security problems that the mobile agent system faces with at presentand the existing protesting schemes for it. Then a solving method based on JavaCard is proposed to protect mobile a-gents. And a feasible solving method is also provided to solve the security problems of JavaCard itself.