Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Package does not exist  RSS feed

 
S Reddy
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am doing a simple Servlet program. I have my directory structure as
classes\valid\fb\InputForm.java
classes\valid\act\Validate.java

I have given "package valid.fb;" in InputForm.java.
And "package valid.act; import java.fb.*;" in Validate.java.

But I am getting error saying that "package valid.fb does not exist". Should I put "valid\fb" in classpath?
 
Anuradha Karunamuni
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For this to correctly work set the classpath to "classes\".
If the relative path does not work, set the fully qualified path for the classpath.
 
S Reddy
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Anuradha. Previously, I was thinking classes is on the class path, so I don't need to mention it separately. It was just came to me that it was on the Tomcat's class path, not on my compiler's class path.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!