I have a method that sends an email to a recipient, which works well, without it being embedded into an applet, but as soon as I do put it in an applet I get the following error: java.lang.NoClassDefFoundError: javax/mail/MessagingException. Any ideas?
This is my applet code:
This is my class that has the method:
Any help would be very appreciated. I have searched on the net, and have had no luck in finding a solutions.
Could it be that the JavaMail jar file is in regular classpath, but that you have not made it accessible to the applet? Applets do not use the classpath a normal application would; you will need to put the jar file into the web directory, togther with the applet files, and reference it in your web page.
One thing to note about applets is that they make use of the jre rather than the jdk, so make sure, if you have multiple java versions installed (jres and/or jdks) that you are using the same one being used when you're running the application. This can be checked through the java control panel (can be accessed through control panel->Java plug-in) Best, Mohammad
Joined: Dec 30, 2004
Mohammad, Thanks for all your help!
You know I read your post about your imageio problem and unfortunately I have no help that I can provide, but, I was wondering if you could post an example of detecting the clients jre environment and how one could overwrite an older one with a newer one.
Joined: Nov 17, 2005
Graham, you can detect that by simply changing the html file containing your applet (which now i guess contains an applet tag) using a utility called htmlconverter.exe which comes inside the jdk\bin directory using this utility would allow you to change the html file into one that would automatically check for the current installed version of jre on the client side, and then would install the version that you specified in the htmlconversion process if an older version is already there and thanks for offering help..that's okay Best, Mohammad