0

I am trying to use the java Mail API in my program, i have the library added to my package folder but when i go to run the program it says that it cant find class javax.mail.internet.InternetAddress but when i open the library i can see the class file there...so what gives?

04-21 10:30:25.202: ERROR/dalvikvm(3065): Could not find class 'javax.mail.internet.InternetAddress', referenced from method com.app.notifyme.GmailReciever.createNotification
04-21 10:30:30.632: ERROR/AndroidRuntime(3065): FATAL EXCEPTION: main
04-21 10:30:30.632: ERROR/AndroidRuntime(3065): java.lang.VerifyError: com.app.notifyme.GmailReciever
04-21 10:30:30.632: ERROR/AndroidRuntime(3065):     at java.lang.Class.newInstanceImpl(Native Method)
04-21 10:30:30.632: ERROR/AndroidRuntime(3065):     at java.lang.Class.newInstance(Class.java:1409)
04-21 10:30:30.632: ERROR/AndroidRuntime(3065):     at android.app.ActivityThread.handleReceiver(ActivityThread.java:1885)
04-21 10:30:30.632: ERROR/AndroidRuntime(3065):     at android.app.ActivityThread.access$2400(ActivityThread.java:123)
04-21 10:30:30.632: ERROR/AndroidRuntime(3065):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:989)
04-21 10:30:30.632: ERROR/AndroidRuntime(3065):     at android.os.Handler.dispatchMessage(Handler.java:99)
04-21 10:30:30.632: ERROR/AndroidRuntime(3065):     at android.os.Looper.loop(Looper.java:123)
04-21 10:30:30.632: ERROR/AndroidRuntime(3065):     at android.app.ActivityThread.main(ActivityThread.java:3839)
04-21 10:30:30.632: ERROR/AndroidRuntime(3065):     at java.lang.reflect.Method.invokeNative(Native Method)
04-21 10:30:30.632: ERROR/AndroidRuntime(3065):     at java.lang.reflect.Method.invoke(Method.java:507)
04-21 10:30:30.632: ERROR/AndroidRuntime(3065):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
04-21 10:30:30.632: ERROR/AndroidRuntime(3065):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
04-21 10:30:30.632: ERROR/AndroidRuntime(3065):     at dalvik.system.NativeStart.main(Native Method)
1
  • You might take a look at this question: stackoverflow.com/questions/100107/… It talks about verify errors. My guess is that you have differences between your compile and runtime classpaths. Commented Apr 21, 2011 at 15:50

2 Answers 2

1

My guess is that you're missing the Activation API (usually called activation.jar), which is a dependency of JavaMail. If you don't have it, you'll get confusing classloading exceptions like this one.

activation.jar is usually found alongside mail.jar.

P.S. Fir future reference, if you want to ask about an exception on Stackoverflow, then show us the exception.

Sign up to request clarification or add additional context in comments.

3 Comments

there is no activation.jar so where do i get it then?
added the file, i no longer get the cannot find class error but i still get everything else
0

A nifty site is jarFinder. When I put your above class in it, jarFinder lists 14 versions in 110 different jar packages.

The big question is whether you have any of those jars in your classpath. I'm thinking you will need to add it with a set classpath command.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.