Yes, you can. Jonathan Meyer's Jasmin
Java assembler is a small assembler for Java byte code, and would be of great assistance to you in such an endeavor. The Java interpreter will check your byte codes to make sure they don't violate security. If you write security violating byte codes the interpreter won't run them.
Posted in: Java