• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem importing user created classes

 
J Chitra
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a probem with importing. The directory structure is like this:

I have a java_files as the base directory. and under that I have 2 dir.s: class_files & source_files.

Now,what am trying is :
i have 2 .java files in the source_files directory:
1.source_files\a\b\c1\java1.java and
2.source_files\a\b\c2\java2.java

I declared java2.java(in which all the class,method names are public) in a package called a.b.c2 and wrote the .class file to the class_files directory using -d while compiling.

when i tried to import a.b.c2.*; in my java1.java, i get a compiler error saying that package a.b.c2 does not exist.

Where is the problem? I checked the the existence of the .class file in class_files\a\b\c2. It IS there.
 
Mike Gershman
Ranch Hand
Posts: 1272
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please display your entire CLASSPATH and post it here.

In the example you gave, c:\...\java_files\class_files should be in your CLASSPATH.
[ October 30, 2004: Message edited by: Mike Gershman ]
 
J Chitra
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Mike. I changed the classpath to class_files dir and its working fine now.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic