Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > JSP Basics
|
JSP Basics Beginning-level questions on JSP. More advanced coders should post to Pro JSP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the JSP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 26th, 2003, 11:29 PM
Registered User
 
Join Date: Jul 2003
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to ioda006
Default cannot resolve symbol problem

I've been looking around for a solution like hell for this chapter 6 problem. I finally found something in the p2p archives that worked though:

You can get around this by compiling all the classes in one shot:
javac com/wrox/library/*.java (on Unix. Try with \ instead of / on windows)
Cheers,
Dmitry
> Hello all,
>
> I need help in solving a problem:
>
> I'm trying to do inheritance using extends. I have book class as my
> superclass and two subclasses: ChildrenBook and TechnicalBook. I don't
> have any error when I compile the book class. However, I got compile
> error when I compile the two subclasses. This is the error message:
>
> ChildrenBook.java:3: cannot resolve symbol
> symbol : class Book
> location: class begjspCh07.ChildrenBook
> public class ChildrenBook extends Book
> ^
> 1 error
>
> I attach all my source code below:
> 1. Book.java
>
> package begjspCh07;
>
> public class Book
> {
> private String title;
>
> public String getTitle()
> {
> return title;
> }
>
> public void setTitle(String title)
> {
> this.title = title;
> }
>
> public Book()
> {
> }
>
> public Book(String title)
> {
> this.title = title;
> }
> }
>
> 2. ChildrenBook.java
>
> package begjspCh07;
>
> public class ChildrenBook extends Book
> {
> private int minimumAge;
>
> public int getMinimumAge()
> {
> return minimumAge;
> }
>
> public void setMinimumAge(int a)
> {
> minimumAge = a;
> }
>
> public ChildrenBook()
> {
> super();
> }
>
> public ChildrenBook(String title)
> {
> super(title);
> }
> }
>
> 3. TechnicalBook.java
>
> package begjspCh07;
>
> public class TechnicalBook extends Book
> {
> private String skillLevel;
>
> public int getSkillLevel()
> {
> return skillLevel;
> }
>
> public void setSkillLevel(String s)
> {
> skillLevel = s;
> }
>
> public TechnicalBook()
> {
> super();
> }
>
> public TechnicalBook(String title)
> {
> super(title);
> }
> }
>
> Thanks in advance,
> Lita Loe

This one finally worked for me. What I would like to know is *WHY* it works. I can't complie these files seperately, but they work fine when i do them all at once? I don't get it.

Also, I haven't tried this out yet, but I was looking at a response to another recent post from acmp2002 and it said to fix the problem try:
Hi
Try the following commands this will compile your code without error
For Book.java
javac -d "c:\Program Files\Apache Softwae Foundation\Tomcat 5.0\webapps\objects\WEB-INF\classes\booklibrary" booklibrary\Book.java

This command will create folder of your package name specified in your Book.java

For ChildrenBook.java
javac -d "c:\Program Files\Apache Softwae Foundation\Tomcat 5.0\webapps\objects\WEB-INF\classes\booklibrary" -classpath "c:\Program Files\Apache Softwae Foundation\Tomcat 5.0\webapps\objects\WEB-INF\classes\booklibrary" booklibrary\ChildrenBook.java

For TechnicalBook.java
javac -d "c:\Program Files\Apache Softwae Foundation\Tomcat 5.0\webapps\objects\WEB-INF\classes\booklibrary" -classpath "c:\Program Files\Apache Softwae Foundation\Tomcat 5.0\webapps\objects\WEB-INF\classes\booklibrary" booklibrary\TechnicalBook.java

Regards

Yashraj Chauhan
Java\J2EE Specialist
Wiley Support Team

does anyone know if that actually works? i suppose i should try it myself just to see.

Any explanation appreciated. Thanks,

JC

 
Old July 28th, 2003, 06:00 AM
Authorized User
 
Join Date: May 2003
Posts: 50
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi

I think u should try this out this works as i myself had tried it

Regards


Yashraj Chauhan
Java\J2EE Specialist
Wiley Support Team
 
Old July 28th, 2003, 06:04 AM
Registered User
 
Join Date: Jul 2003
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to ioda006
Default

I'm on chapter 7 now.. i encountered another problem with the ListDemo.java file. same error i ended up using:

D:\Programs\Apache Software Foundation\Tomcat 5.0\webapps\Utility\WEB-INF\classe
s>javac com\wrox\utilities\User.java ListDemo.java

i tried the *.java thing first, but that only does stuff for the initial directory.

well now that i know how to do it and know what doesnt work, can someone tell me why this does work and i cant compile these files individually?







Similar Threads
Thread Thread Starter Forum Replies Last Post
How to resolve #Name? Error problem in few fields jack123 Access 1 August 2nd, 2007 02:08 PM
java bean file not found / cannot resolve symbol r Calverstine JSP Basics 4 July 3rd, 2006 05:38 AM
cannot resolve symbol (struts) tomeksupergosc J2EE 2 November 23rd, 2004 01:19 PM
Error-cannot resolve symbol Rusk JSP Basics 1 February 18th, 2004 09:20 AM
Error: Cannot resolve symbol "Beginning JSP" amcp2002 Wrox Book Feedback 2 July 22nd, 2003 03:30 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.