<br>How to import the user-defined package in a java file. </br>
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   PhiDi_TranThi
Posted On:   Monday, July 8, 2002 11:31 AM

when I try to import a user-defined package,the package util, in my java file as the following: package magenta.app.imsServer; import java.io.PrintStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.File; import java.util.Vector; import java.util.Date; import java.net.DatagramPacket; import java.net.InetAddress; import java.net.UnknownHostException; import magenta.util.MException; import magenta.util.MError; import magenta.util.Util; import magenta.util.Shutdownable   More>>


when I try to import a user-defined package,the package util, in my java file as the following:





package magenta.app.imsServer;

import java.io.PrintStream;

import java.io.FileOutputStream;

import java.io.IOException;


import java.io.File;


import java.util.Vector;


import java.util.Date;




import java.net.DatagramPacket;


import java.net.InetAddress;


import java.net.UnknownHostException;



import magenta.util.MException;


import magenta.util.MError;


import magenta.util.Util;


import magenta.util.Shutdownable;


import magenta.util.OnShutdown;




The util package is under C:aircanadamagentautil directory which includes all the java files above and more. I also have set the Classpath, path enviroment variables pointing to these directories but my compiler still does not recognize this package and generate the following error message:




"package magenta.util does not exist" for each of the file that's imported from the util packages...



Could some one help.



Thanks and regards,



PhiDi Tran.

   <<Less

Re: <br>How to import the user-defined package in a java file. </br>

Posted By:   Steven_Martin  
Posted On:   Monday, July 8, 2002 12:44 PM

Make sure the source file has the item


package magenta.util;

as the first line. Otherwise you are pointing to the directory not the package.
About | Sitemap | Contact