Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

help for HFSJ - CH 3 Page 84

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ,

I am doing the first web application given in the book.(HFSJ - page 84)

I am now trying to compile 'BeerExpert.java' file but i get error:
----------------------------------------------------------------------
C:\Program Files\Apache Software Foundation\Tomcat 5.5\Myprojects\beerV1>javac -
d classes src/com/example/model/BeerExpert.java
Note: src/com/example/model/BeerExpert.java uses unchecked or unsafe operations.

Note: Recompile with -Xlint:unchecked for details.
----------------------------------------------------------------------

But at the same time i see a correspoding class file generated for 'BeerExpert' and placed in floder 'Classes/com/example/model'.

nOW if i try compiling 'BeerSelect.java' file i get error:
----------------------------------------------------------------------
C:\Program Files\Apache Software Foundation\Tomcat 5.5\Myprojects\beerV1>javac -
d classes src/com/example/web/BeerSelect.java
src/com/example/web/BeerSelect.java:3: package com.example.model does not exist
import com.example.model.*;
^
src/com/example/web/BeerSelect.java:18: cannot find symbol
symbol : class BeerExpert
location: class com.example.web.BeerSelect
BeerExpert bx = new BeerExpert();
^
src/com/example/web/BeerSelect.java:18: cannot find symbol
symbol : class BeerExpert
location: class com.example.web.BeerSelect
BeerExpert bx = new BeerExpert();
^
3 errors
----------------------------------------------------------------------


Please help, thanks.
 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi...
I hope that you have found out the answer you have posted here... Anyways... if I am not 2 Late... The probable answer would be:

Actually the Current Directory might not be in the Classpath..If thats the case then please do add .; infront of the Classpath...whereever you have set those Enviornment Variables(My Computer-> Advanced tab->Enviornment Variables)

I hope this helps...
 
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi anand,

Have you solved your problem? The problem is your classpath setting. classes is missing. My setting (under Windows XP) is as follow. You can also put the classpath setting in the command line.

java_home
C:\Program Files\Java\jdk1.5.0_04\

Tomcat_home
C:\Program Files\Apache Software Foundation\Tomcat 5.5\

classpath
.;classes;%java_home%jre\lib\rt.jar;%Tomcat_home%common\lib\servlet-api.jar
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic