File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes package not found Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "package not found" Watch "package not found" New topic
Author

package not found

jaimin gohel
Greenhorn

Joined: Jul 30, 2008
Posts: 13
i have a registration.java file in which i have imported a custom package maned "import com.brainysoftware.java.StringUtil;" but am having only class file of package "StringUtil".

so when i compile registration.java file the console shows me error of "package not found".

so what should i do to use this particular package.

my directory structure for the package is :
D:\tomcat5.0.19\webapps\myApp\WEB-INF\classes\com\brainysoftware\java\StringUtil.class
Sandeep Bhandari
Ranch Hand

Joined: Apr 16, 2004
Posts: 201
where is registration.java placed?


SCJP 96% | SCWCD 90%| SCJP mock exams | My SCJP blog
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41499
    
  53
Is the directory D:\tomcat5.0.19\webapps\myApp\WEB-INF\classes in your classpath when you compile?


Ping & DNS - my free Android networking tools app
jaimin gohel
Greenhorn

Joined: Jul 30, 2008
Posts: 13
registration.java is posted in the directory :

D:\tomcat5.0.19\webapps\myApp\src

and StringUtil.class package is placed in :

D:\tomcat5.0.19\webapps\myApp\WEB-INF\classes\com\brainysoftware\java
jaimin gohel
Greenhorn

Joined: Jul 30, 2008
Posts: 13
D:\tomcat5.0.19\webapps\myApp\WEB-INF\classes

in the above directory I put all my .class files of the application.
Sandeep Bhandari
Ranch Hand

Joined: Apr 16, 2004
Posts: 201
Originally posted by jaimin gohel:
registration.java is posted in the directory :

D:\tomcat5.0.19\webapps\myApp\src

and StringUtil.class package is placed in :

D:\tomcat5.0.19\webapps\myApp\WEB-INF\classes\com\brainysoftware\java


How come registration.java can know that it has to add WEB-INF\classes before going to com\brainysoftware\java.
As somebody said, you can use classpath
jaimin gohel
Greenhorn

Joined: Jul 30, 2008
Posts: 13
thank for the suggestion the issue is over now.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: package not found