In Java programming, probably moreso than .NET programming, open-source software is used a great deal in project, if nothing else then by including some of the common-* libraries from the Apache project. You will also find Spring being used a great deal, and various projects from Google code may be found. You will find some many open-source .NET programs that are just ports of Java open-source projects.
As Benjamin mentioned, for packaging, EAR and WAR files are very common, but for a complicated application you may have several EAR files that need to be installed, but you may find other programs are also needed to help facilitate integrating with other enterprise applications.
For example, you may want to include JAX-WS 2.2 if you need some features there for webs ervices, that aren't included in java distributions. If you are using Grails to do your front-end then that will be in a common library directory so your various ear files can use it. So, an installer would be useful.
You may need to support multiple application servers, so different configuration files may be needed to get everything working better.
Then you have database support, as you will want to support multiple databases, otherwise you are limiting your market to just those that have the software you choose to support.
Anything can be decompiled, even if it is just looking at the assembly code of a C program, to see how it works. This is just a fact in the computer world.
But, you can make it hard enough to look at that it may not be worth the effort to go through these steps.
You can get fairly standard legal contracts that state it is a violation of the agreement to decompile or modify the code, but that is best handled between you and a lawyer.
If you are really concerned about people getting any access to your code, then have your J2EE app go to your company site for the processing, but, then you have limited your market again, because some companies have policies that forbid such software, as everything needs to be hosted on-site.
So, decide what market you are interested in, then start to look at what you can do to not limit who can use your application within your target market, by looking at commonly used databases, application servers, what languages are used on the servers, what policies may constraint your design.