as well the classes [have same structure as above, created while compilation with -d option]
my plain java code
my servlet code
i compile plain java file :
javac -d classes src/com/example/model/GetBeers.java [works, compiles and stores the .class file in classes directory structure]
but
javac -d classes src/com/example/web/SelectBeer.java [gives compilation error, while importing package model .... ]
i guess i'm missing something [maybe my classpath is not correct] or
maybe the import statement is looking into : src/com/example/model rather than looking in classes/com/example/model ......
The first classpath tells where the servlet-api is located.
The second ones (probably) stating that "Please look inside the classes"
ALso . (probably) stands for "look in the current directory/folder too"
Please some correct me if I am wrong
This message was edited 1 time. Last update was at by Ankit Garg
Working on my SCWCD so I can be a J2EE consultant earning millions of dollars and showing everyone I can
The first classpath tells where the servlet-api is located.
The second ones (probably) stating that "Please look inside the classes"
ALso . (probably) stands for "look in the current directory/folder too"
Please some correct me if I am wrong
i have the servlet-api.jar and jsp-api.jar in my classpath. i have mentioned that i can run the servlets, but here i'm facing little of package access problem, not servlet problem.
The first classpath tells where the servlet-api is located.
The second ones (probably) stating that "Please look inside the classes"
ALso . (probably) stands for "look in the current directory/folder too"
Please some correct me if I am wrong
i have the servlet-api.jar and jsp-api.jar in my classpath. i have mentioned that i can run the servlets, but here i'm facing little of package access problem, not servlet problem.
See the second class path is to find the classes inside the classes folder and third one if any in current folder. ...Umm have you tried my solution and checked if it worked? I have a feeling it will work. By stating where you package is (in other words where the classes of the package is) your app will work. Just try out ok in command prompt. Thanks
The first classpath tells where the servlet-api is located.
The second ones (probably) stating that "Please look inside the classes"
ALso . (probably) stands for "look in the current directory/folder too"
The first classpath tells where the servlet-api is located.
The second ones (probably) stating that "Please look inside the classes"
ALso . (probably) stands for "look in the current directory/folder too"
The first classpath tells where the servlet-api is located.
The second ones (probably) stating that "Please look inside the classes"
ALso . (probably) stands for "look in the current directory/folder too"
i have screwed up my brain by declaring the "classes" folder in the environment variable, but never worked from there ... i guess because of the relative/absolute stuff ... anyways i'm not good with packaging.
subject: Cannot Access Model Package, While Compiling Servlet