I am trying to send an email using the JavaMail API. I have jdk 1.5 installed in my home directory from a self-extracting binary. I'm on Ubintu 9.10
I will compile the program using the following command:
~ / 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
It compiles OK. As you can see, I have indicated the path to mail.jar and activ.jar. Now I am trying to start the application using the following command:
~ / 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 0.3 /mail.jar :. HelloWorldApp
I get java.lang.NoClassDefFoundError exception: javax / mail / Address
Why can it find classes at compilation and cannot do this at startup? How to launch my application?
Thank you in advance
CITBL source
share