Compiled OK but NoClassDefFoundError when running
<p>I'm trying to send an email using JavaMail API.
I have jdk 1.5 installed in my home directory from self-extracting binary. I'm on Ubintu 9.10</p>

<p>I compile the program using the next command:</p>

<p>~/jdk1.5.0_22/bin/javac -classpath ~/jdk1.5.0_22/jre/lib/javamail-1.4.3/mail.jar:~/jdk1.5.0_22/jre/lib/jaf-1.1.1/activation.jar hw.java</p>

<p>It compiles OK. As you can see I have specified the path to mail.jar and activation.jar
Now I try to run the app using the next command:</p>

<p>~/jdk1.5.0_22/bin/java -classpath ~/jdk1.5.0_22/jre/lib/jaf-1.1.1/activation.jar:~/jdk1.5.0_22/jre/lib/javamail-1.4.3/mail.jar:. HelloWorldApp</p>

<p>I get an exception java.lang.NoClassDefFoundError: javax/mail/Address</p>

<p>Why can it find classes when compiling and cannot do it when running?
How to correctly run my app?</p>

<p>Thanks in advance</p>
