aspose file tools*
The moose likes Beginning Java and the fly likes package visibility problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "package visibility problem" Watch "package visibility problem" New topic
Author

package visibility problem

rewati raman
Ranch Hand

Joined: May 22, 2010
Posts: 62
Hi I am getting this error when i am compiling with this command: javac -classpath /home/rewati/Downloads/apache-tomcat-6.0.28/lib/servlet-api.jar:classes:. -d classes src/info/registration/web/Register.java

this is the error:

src/info/registration/web/Register.java:2: package info.registration.model does not exist
import info.registration.model.*;
^
src/info/registration/web/Register.java:17: package info.registration.model does not exist
info.registration.model.NewUser.reg(firstname,lastname,sex,email,"fytf");
^
2 errors
Process javac exited with code 1

[/code]

here is my code






Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

You need to put your src folder in your classpath, to tell the compiler where to find the info package. It looks like your are compiling from the root directory of src, so try with : javac -classpath /home/rewati/Downloads/apache-tomcat-6.0.28/lib/servlet-api.jar:classes:.:./src -d classes src/info/registration/web/Register.java


[My Blog]
All roads lead to JavaRanch
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: package visibility problem