File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes classes in the same package don't compile...why? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "classes in the same package don Watch "classes in the same package don New topic
Author

classes in the same package don't compile...why?

Ayman Jaffar
Ranch Hand

Joined: Sep 06, 2000
Posts: 57
Howdy again,
My OS is "Windows 2000 Server"
1- I have a package called "coreservlets"
2- I have two classes in the package, one is called "ServletUtilites" and the other is "HelloWWW3"
3- "HellowWW3" which is using "ServletUtilites" class, isn't compiling because it's not recognizing the "ServletUtilities" which is in the same package
4- the error that I get is.
C:\jakarta-tomcat-4.0.4\webapps\ROOT\WEB-INF\classes\coreservlets\HelloWWW3.java:13: cannot resolve symbol
symbol : class ServletUtilities
location: package coreservlets
out.println(coreservlets.ServletUtilities.headWithTitle("Hello WWW") +
^
1 error
I've set the classpath "%classpath%;.;C:\jakarta-tomcat-4.0.4\common\lib\servlet.jar"
so why isn't HelloWWW3 compiling.
thanks.
[ June 24, 2002: Message edited by: Ayman Jaffar ]

america
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60810
    
  65

What does your compile command look like?
bear


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Ayman Jaffar
Ranch Hand

Joined: Sep 06, 2000
Posts: 57
It's now working for me.
I went to the directory where the .java files were stored and at the dos prompt typed "javac *.java" and it worked!!!
thanks.
[ June 24, 2002: Message edited by: Ayman Jaffar ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: classes in the same package don't compile...why?
 
Similar Threads
how to compile utility class
compiling with packages
package issue
ServletUtilities class
classpath setting rightly. But strange problem