I created a package and placed a .java file in it.When i tried to import the package & the file into another source file,i get a error,saying that the package was not found. Pl.help.
You need to include "to be" imported file in your class path ? Are you developing on windows platform or Unix? If classpath is already defined in your session, you can add the following in your startup script or in windows in env variables (control panel - system) Unix - setenv CLASSPATH $CLASSPATH /java/xxx /your_dir_path Windows - set classpath=%classpath%;d:\your_dir_path hope it helps .. [ May 20, 2002: Message edited by: Gaurav Mantro ]
No,it's not. This is the first time iam working with packages.So,it would be very helpful,if the concept could be explained in great detail.Thanks in advance.
Hi, you can make a jar file and giving the exact path of that jar file as a Classpath..this will better for a beginner's..way's to create a jar file is jar -cvf test.jar [package's root directory ex: com\] try it out
Rajasekaran, I disagree entirely that constructing and using jar files would be easier for a beginner or even an advanced programmer. Use of jar files would add another layer of complication to the matter. The packages would still need to be constructed and referenced correctly and classpath settings may still need to be altered.