No, it's harder to write a virus in Java (which is, good or bad, what it sounds like you're trying to do).

Java maintains a virtual machine in a single operating system process. This VM is...