In some mobile terminal platforms, such as Android, OMS (Open Mobile System), etc, the compiled Java application files could be easily decompiled, so the security of source codes in Java application is a problem. In this paper, we analyze traditional protective methods for Java application files. Then a class-loading mechanism using variable-instruction-sets encryption is raised. Variable-instruction-sets encryption is a highly reliable and efficient algorithm which is applied on instruction level. Test results on prototype machine show that this mechanism is effective.