This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

BeerExpert.java uses unchecked or unsafe operations

 
vishwak rajgopalan
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I am not sure whether this is the appropriate forum to post this. Please excuse me if I have made an error. I have been using HeadFirst Servlets and JSP and I compiled the BeerSelect.java code (the second version of the controller servlet).
I get the following error message saying that the package com.example.model does not exist. Please help me as I am unsure how to proceed with debugging this issue. I have pasted the error message below


D:\MyProjects\beerV1>javac -d classes src/com/example/web/BeerSelect.java
src/com/example/web/BeerSelect.java:20: cannot access src.com.example.model.BeerExpert
bad class file: .\src\com\example\model\BeerExpert.java
file does not contain class src.com.example.model.BeerExpert
Please remove or make sure it appears in the correct subdirectory of the classpath.
BeerExpert be = new BeerExpert();

Thanks,
Vishwak
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just make sure your pacakge name matches the directory structure that the file is in and that your filename matches the class name of your class's signature.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looks like you're compiling it as src.com.etc.etc rather than com.etc.etc, as below. Not a stupid question, we've had this question a couple of times so I'll point it out to Bert and Kathy, maybe they can look at polishing these instructions in the next edition!



Dave
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic