Aaron de Souza

Greenhorn
+ Follow
since Jul 11, 2009
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Aaron de Souza

Jason Irwin wrote:Well, the obvious answer is that your classpath is wrong, the compiler simply cannot find "BeerExpert". I think it's "classes:." that is the problem.

Try:
javac -classpath "c:\Program Files\Apache Software Foundation\Tomcat 5.5\common\lib\servlet-api.jar";.\classes -d classes src\com\example\web\BeerSelect.java

You will be able to compile from that location once you have your classpath correct.

Like the project name....



Doh! Thanks Jason, the problem was with "classes:." it should have been "classes;."

Aaron
12 years ago
Hi,
I'm working through Head First Servlets & JSP and I've come across a problem when I try to compile a class.

The command I'm trying to compile the class with is

F:\Head First Servlets\beerV1>javac -classpath "c:\Program Files\Apache Software Foundation\Tomcat 5.5\common\lib\servlet-api.jar";classes:. -d classes src\com\example\web\BeerSelect.java

and the error I am getting is

src\com\example\web\BeerSelect.java:3: package com.example.model does not exist
import com.example.model.*;
^
src\com\example\web\BeerSelect.java:13: cannot find symbol
symbol : class BeerExpert
location: class com.example.web.BeerSelect
BeerExpert be = new BeerExpert();
^
src\com\example\web\BeerSelect.java:13: cannot find symbol
symbol : class BeerExpert
location: class com.example.web.BeerSelect
BeerExpert be = new BeerExpert();
^
3 errors

F:\Head First Servlets\beerV1>

The BeerExpert.class is located in F:\Head First Servlets\beerV1\classes\com\example\model\BeerExpert.class

Not sure what I'm doing wrong, hope someone can help...

Aaron
12 years ago