File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

package

 
Cameron Park
Ranch Hand
Posts: 371
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8521
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So what is the problem?
 
Cameron Park
Ranch Hand
Posts: 371
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 371
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8521
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 358
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic