?
Solved

Package problem

Posted on 2003-03-06
12
Medium Priority
?
226 Views
Last Modified: 2010-03-31
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
Comment
Question by:y_pua
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
  • 2
  • +2
12 Comments
 
LVL 92

Expert Comment

by:objects
ID: 8086456
You need to install javamail and javabean activation framework.

http://java.sun.com/products/javamail/
http://java.sun.com/beans/glasgow/jaf.html
0
 
LVL 1

Accepted Solution

by:
umangjoshi earned 200 total points
ID: 8086460
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
 
LVL 92

Expert Comment

by:objects
ID: 8086492
umangjoshi,

The packages come with install instructions :)
0
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 

Author Comment

by:y_pua
ID: 8086561
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
 

Author Comment

by:y_pua
ID: 8086578
Dear Objects
 
after i download the package from http://java.sun.com/beans/glasgow/jaf.html, which java folder should i put into?
0
 
LVL 92

Expert Comment

by:objects
ID: 8086619
> which java folder should i put into?

<java>/lib/ext
0
 

Author Comment

by:y_pua
ID: 8086645
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
 
LVL 92

Expert Comment

by:objects
ID: 8086655
> how should i solve the problem?

You need to install the jars in the ext folders of *both* the jdk *and* the jre.
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 8087250
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
 

Expert Comment

by:doddjames
ID: 8087334

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
 
LVL 92

Expert Comment

by:objects
ID: 8091454
> 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
 
LVL 30

Expert Comment

by:Mayank S
ID: 8544925
How about rating it now?
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Suggested Courses
Course of the Month11 days, 16 hours left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question