y_pua
asked on
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.
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
umangjoshi,
The packages come with install instructions :)
The packages come with install instructions :)
ASKER
Dear umangioshi,
i had downloaded the javamail....but still have the problem of package javax.activation...so..wha t should i do now? Thanks a lot.
i had downloaded the javamail....but still have the problem of package javax.activation...so..wha
ASKER
Dear Objects
after i download the package from http://java.sun.com/beans/glasgow/jaf.html, which java folder should i put into?
after i download the package from http://java.sun.com/beans/glasgow/jaf.html, which java folder should i put into?
> which java folder should i put into?
<java>/lib/ext
<java>/lib/ext
ASKER
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.NoClassDefFoundE rror: was shown. So, according to this situation, how should i solve the problem? Thanks for yr help.
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.NoClassDefFoundE
> how should i solve the problem?
You need to install the jars in the ext folders of *both* the jdk *and* the jre.
You need to install the jars in the ext folders of *both* the jdk *and* the jre.
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.
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.
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.
> 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?
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?
How about rating it now?
http://java.sun.com/products/javamail/
http://java.sun.com/beans/glasgow/jaf.html