In order to be able to protect and encrypt your Java applications you need to convert them to standalone executable applications first. You can use Excelsior JET compiler for this purpose.
Knowledge base