I have created ubuntu 10.04 ec2 image and now I need to install tomcat apache and jdk6 on my instance but whenever I use the command sudo apt-get install sun-java6-jdk
I am a bit confused, if you just want to install Java and Tomcat, why are you also trying to install the ec2 tools?
In any case, I also want to mention the free BitNami Cloud Tools installer (disclaimer: I am one of the developers). It includes the JDK and all EC2-related tools. We keep it fairly up-to-date and can run as a regular user.