• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 231
  • Last Modified:

Package problem

Hi,

I am facing the below problem while i am compiling my java program. So according to the below error, how i able to solve the problem? and where should i get those package?


package javax.mail does not exist.
package javax.mail.internet does not exist.
package javax.activation does not exits.

Thanks for yr help. Plz reply as soon as posible.
0
y_pua
Asked:
y_pua
  • 5
  • 3
  • 2
  • +2
1 Solution
 
objectsCommented:
You need to install javamail and javabean activation framework.

http://java.sun.com/products/javamail/
http://java.sun.com/beans/glasgow/jaf.html
0
 
umangjoshiCommented:
have u download this packages?

if no
   pls download it from
   http://java.sun.com/products/javamail/
   and place .jar files in jre\lib\ext folder where
   u have installed your java
else
   place mail.jar and activation.jar files in
   jre\lib\ext folder where u have installed your java


pls try it
   
0
 
objectsCommented:
umangjoshi,

The packages come with install instructions :)
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
y_puaAuthor Commented:
Dear umangioshi,

i had downloaded the javamail....but still have the problem of package javax.activation...so..what should i do now? Thanks a lot.
0
 
y_puaAuthor Commented:
Dear Objects
 
after i download the package from http://java.sun.com/beans/glasgow/jaf.html, which java folder should i put into?
0
 
objectsCommented:
> which java folder should i put into?

<java>/lib/ext
0
 
y_puaAuthor Commented:
dear,

I have installed all the packages and it was success to compile. But when i run it, the problem "Exception In Thread "main" java.lang.NoClassDefFoundError: was shown. So, according to this situation, how should i solve the problem? Thanks for yr help.
0
 
objectsCommented:
> how should i solve the problem?

You need to install the jars in the ext folders of *both* the jdk *and* the jre.
0
 
Mayank SAssociate Director - Product EngineeringCommented:
It might be simply a very titular problem.

If its giving a NoClassDefFoundError right when you're typing the java <classname> command, then just make sure that you've entered the classname with the correct case. For example, if the class containing the main () method is "Abcd", then make sure that your source-file is named "Abcd.java", and then execute the following command after compiling the program:

java Abcd

Try it... if you still face problems, then just let me know.
0
 
doddjamesCommented:

Hey,

It is a common case that you need jars to compile against but also extra jars to run against.  This is because the implementations of the interfaces you compiled against are not known until runtime and is a pretty basic Java concept.

So what you have here is successful compilation against the JavaMail API interfaces, but no 'provider' of these interfaces at runtime.  You can download one from Sun for SMTP no problem.

It sounds like you need a better understanding of the issues you are facing:

http://www.kevinboone.com/classpath.html
http://java.sun.com/products/javamail/FAQ.html

As an aside, it's generally not a good idea to put Jars in lib/ext, as there they will always be picked up by the classloaders first (prepended to classpath), and this may prove problematic in the longer term.
0
 
objectsCommented:
> it's generally not a good idea to put Jars in lib/ext

If this is the case (which I don't believe it is) then what is the purpose of the 'ext' directory?

> and this may prove problematic in the longer term.

why?

0
 
Mayank SAssociate Director - Product EngineeringCommented:
How about rating it now?
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 5
  • 3
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now