Hi I am new to javamail API. I added mail.jar and activation.jar in my jre/lib/ext.But still when I am trying to run programs I am getting an error of java.lang.NoClassDefFoundError in main .. can anyone help !! i really need to begin up coding as the deadline's approaching

You should added the library through your IDE not to mess with Java installation. For example in Netbeans from main menu choose Tools >> Java Platforms . Select a platform you want to add resources for example JKD1.6, select Sources tab and click on Add JAR/Folder. Through file chooser you will navigate to the location of the JAR file and select it.

Similar process is available on every IDE that I used so far