Shagun Bhardwaj wrote:I compliled the code using javac BeerSelect.java
Shagun Bhardway wrote:
My program directories are as follows :-
C:\Program Files\Java\jdk1.6.0_23\bin\BeerSelect.java
C:\Program Files\Java\jdk1.6.0_23\bin\BeerExpert.java
Shagun Bhardway wrote:
And what do you mean by posting the ontroller code twice..how can it be resolved.I am using the .java and .class files in the bin directory and then I am copying it to my tomcat and projets directory as and when required.Is this was you meant..??
Shagun Bhardway wrote:
was trying to implement MVC model in which I made a controller servlet was as follows
(here is the controller servlet source code)
and the model-java class was as follows
(here is the very same controller servlet source code)
Shagun Bhardwaj wrote:And I also tried using the apache-tomcat class path you have given in the previous path to compile the code..it gives the same errors,rather some more.
src
`-- com
`-- example
|-- model
| `-- BeerExpert.java
`-- web
`-- BeerSelect.java
javac com/example/web/BeerSelect.java -cp /home/tomcat7/lib/servlet-api.jar:.
C:\Documents and Settings\user\Desktop\My Projects
BeerV1
etc lib src
    com
      example
        model-->BeerExpert.java
        web--->BeerSelect.java
web classes
    com
      example
        model-->BeerExpert.class
        web--->BeerSelect.class
C:\>
C:\>set CLASSPATH
CLASSPATH=C:\Program Files\Java\apache-tomcat-7.0.6\lib\servlet-api.jar
javac src/com/example/model/BeerSelect.java -d classes
'javac' not recognized as an internal or external command
javac:file not found.
C:\Documents and Settings\user\Desktop\My Projects
javac src/com/example/model/BeerSelect.java -d classes
javac: file not found: src\com\example\web\BeerSelect.java
Usage: javac <options> <source files>
use -help for a list of possible options
Note: src\com\example\model\BeerExpert.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
src\com\example\web\BeerSelect.java:3: package com.example.model does not exist
import com.example.model.*;
^
src\com\example\web\BeerSelect.java:14: cannot find symbol
symbol : class BeerExpert
location: class com.example.web.BeerSelect
BeerExpert be=new BeerExpert();
^
src\com\example\web\BeerSelect.java:14: cannot find symbol
symbol : class BeerExpert
location: class com.example.web.BeerSelect
BeerExpert be=new BeerExpert();
Pedro Kowalski wrote:Assume that the root directory which is presented above (src) is in your working directory (let's say C:\).
Now, being in C:\ execute
javac com/example/web/BeerSelect.java -cp /home/tomcat7/lib/servlet-api.jar:.
The ":." part of the -cp switch (classpath) is necessary.
Of course adjust the path to your servlet-api.jar to point to your copy.
Space pants. Tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|