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 17th, 2003, 03:05 PM
Authorized User
 
Join Date: Jul 2003
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default classpath problem

hi to all, i have started with "beginning JSP web development" and got stuck on chapter 7 about classes. when i try to compile a code i get "cannot resolve symbol"

i followed the instruction on the book on how to install java & tomcat. I also followed the instruction on how to set the environmental variable including the CLASSPATH. I'm using windows 2000 NT. I currently have the classpath set as (under system variable):

        CLASSPATH c:\jakarta-tomcat-4.0\common\lib\servlet.jar;.

I have the files: Book.java, Book.class, TechnicalBook.java & ChildrenBook.java under the following directory:

c:\jakarta-tomcat-4.0\webapps\begjsp-ch07\WEB- INF\classes\com\wrox\library

I'm trying to compile TechicalBook and ChildrenBook and in the code it extends Book. Any help will be appreciated. Thanks.


 
Old July 18th, 2003, 11:09 AM
Authorized User
 
Join Date: Jun 2003
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi amcp2002,
Have you had any luck with this? I am having the same problem!
 
Old July 19th, 2003, 12:41 AM
Authorized User
 
Join Date: May 2003
Posts: 50
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi
I suggest u kindly provide the details of error you r getting after that only i will be able to help u out.

Regards


Yashraj Chauhan
Java\J2EE Specialist
Wiley Support Team
 
Old July 21st, 2003, 06:58 AM
Authorized User
 
Join Date: Jun 2003
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by Yashraj Chauhan
 Hi
I suggest u kindly provide the details of error you r getting after that only i will be able to help u out.
Thanks Yashraj. Here are the details:

When I try to compile the ChildrenBook.java file
 
Quote:
quote: . . . \objects\WEB-INF\classes>javac booklibrary\ChildrenBook.java
Quote:
I get the following error:
 
Quote:
quote: booklibrary\ChildrenBook.java:28: cannot resolve symbol
Quote:
symbol : constructor Book (java.lang.String)
location: class booklibrary.Book
    super(title);
    ^

1 error
* I have compiled the Book.java class successfully.
 
Old July 21st, 2003, 03:04 PM
Authorized User
 
Join Date: Jul 2003
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

That's the same exact mesage I was getting. The cursor or error is pointing on the second "B" of
"public class TechnicalBook extends Book {" of the TechnicalBook.java & ChildrenBook.java

 
Old July 23rd, 2003, 01:11 PM
Authorized User
 
Join Date: Jul 2003
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi,

i finally get it to work after researching on the internet. I had to do the following on the c: prompt.

  cd jakarta-tomcat-4.0\webapps\begjsp-ch07\WEB-INF\classes <enter>

  and then

  javac com\wrox\library\TechnicalBook.java <enter>

  &

  javac com\wrox\library\ChildrenBook.java <enter>

I realized that this is what was exactly on the book.





 
Old July 24th, 2003, 02:29 AM
Authorized User
 
Join Date: Jun 2003
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This is what I have been doing all along - and I still get the same error message.

 
Old July 24th, 2003, 07:27 AM
Authorized User
 
Join Date: Jul 2003
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

pedersen, tell me where your files are located (Book.java, Book.class, TechnicalBook.java, ChildrenBook.java, bookPage1.jsp).
Type the codes too.

Also, what do you have on the CLASSPATH variable?

 
Old July 24th, 2003, 09:31 AM
Authorized User
 
Join Date: Jun 2003
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

acmp,
all java files are in c:\Program files\Apache Software Foundation\Tomcat 5.0\webapps\objects\WEB-INF\classes\booklibrary (haven't got to the jsp page yet).

CLASSPATH variable is .;C:\Program Files\SQLLIB\java\db2java.zip;C:\Program Files\SQLLIB\java\runtime.zip;C:\Program Files\SQLLIB\java\sqlj.zip;C:\Program Files\SQLLIB\bin;%CATALINA_HOME%\common\lib\servle t-api.jar; - is this relevant? as the book said nothing about setting the java tools in the class path, only in the PATH?

Cheers,
Ped

 
Old July 25th, 2003, 02:21 AM
Authorized User
 
Join Date: May 2003
Posts: 50
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi
To compile ChildrenBook.java and TechnicalBook.java you have to set the following classpath.

javac -classpath "c:\jakarta-tomcat-4.0\webapps\begjsp-ch07\WEB-INF\classes" ChildrenBook.java

same for the TechnicalBook.java

Hope this helps



Yashraj Chauhan
Java\J2EE Specialist
Wiley Support Team





Similar Threads
Thread Thread Starter Forum Replies Last Post
exec:java classpath problem mslinn BOOK: Beginning Spring Framework 2 ISBN: 978-0-470-10161-2 2 December 1st, 2008 08:05 AM
problem in setting the classpath. Sibananda Tripathy J2EE 1 May 2nd, 2007 01:08 AM
classpath ekta BOOK: Beginning Java 2 1 March 28th, 2005 11:35 PM
classpath? abdi Java GUI 1 December 8th, 2004 04:44 PM
ClassNotFoundException - CLASSPATH problem? pmckeever JSP Basics 0 December 4th, 2003 10:02 AM





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