It would be good if you start with this:
https://awsdocs.s3.amazonaws.com/gettingstarted/latest/awsgsg-intro.pdf
This link should give you the complete the know-how.
And yes, it is possible to deploy your Java EE to EC2. These are the probable steps:
1. Begin by starting an instance
2. Then Install a Java EE application server
3. Install your application (war/ear) into the application server
These the options you have
1.you can bundle the above into an ebs ami,
2. you can write a script (bash/tcl) which will apply these changes when your instance initiates. The scripts enables modification of what gets installed/started/moved around without having to rebundle your instance.