This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills and have John Sonmez on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes package Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "package" Watch "package" New topic
Author

package

Cameron Park
Ranch Hand

Joined: Apr 06, 2001
Posts: 371
Hi, I have a problem compiling a java file that uses an interface that is defined in the same package as the file to be compiled.
//file to be compiled
package tagext;
public class test {
NameContext a;
}

//file to be used
package tagext;
/**
*Interface to provide context for nested tags
*/
public interface NameContext {
String getName();
}

[This message has been edited by Cameron Park (edited July 04, 2001).]
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
So what is the problem?


"JavaRanch, where the deer and the Certified play" - David O'Meara
Cameron Park
Ranch Hand

Joined: Apr 06, 2001
Posts: 371
When I tried to compile test.java, javac says can not resolve NameContext. (I assume NameContext was inaccessible to test.java even though both are in the same package).
Cameron Park
Ranch Hand

Joined: Apr 06, 2001
Posts: 371
Please help...
BTW, I just arbitrarily created a /tagext directory under some Windows directory. Can that be the problem is, CLASS PATH? But in alot of servlet/JSP projects I did, I have a com package some where in the wb application heirachy without setting class path. And they worked fine.
[This message has been edited by Cameron Park (edited July 04, 2001).]
[This message has been edited by Cameron Park (edited July 04, 2001).]
[This message has been edited by Cameron Park (edited July 04, 2001).]
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
the tagext directory need to be under one of the directories named in your CLASSPATH.
So if your CLASSPATH is
c:\jdk1.3.0\bin;c:\jdk1.3.0\mystuff
then the package should be in
c:\jdk1.3.0\mystuff\tagext
rani bedi
Ranch Hand

Joined: Feb 06, 2001
Posts: 358
If your physical directory tagext is at the path
C:\mypath\
then you should be able to compile the test.java
C:\myPath>javac tagext\test.java


Cheers,<br />Rani<br />SCJP, SCWCD, SCBCD
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: package