|
First of all don't tear your hair out because :
a) You won't look good and
b) It won't solve your problem.
I guess you are trying to do too much too soon.
In my opinion first try compiling the two classes from the command line and
once you are successful, try doing the same within Forte.
There isn't any problem getting the Book class to compile.
After you have done that set the classpath variable from the command prompt
by giving the following command.
set classpath=%classpath%;c:\Program Files\Jakarta Tomcat
4.0\webapps\begjsp-ch07\WEB-INF\classes;
Out here double check the path.
One thing to note here is that if possible don't have spaces within the
folder names.
for eg. our classpath command would be something like this :
set
classpath=%classpath%c:\tomcat\jakarta-tomcat-4.0-m5\webapps\cedric\WEB-INF\classes;
After that assuming you are still in the library folder compile the
ChildrensBook.java file.
Assume this should help you.
Have a nice day. With regards, Sachin S. Khanna
----- Original Message -----
Sent: Monday, September 24, 2001 9:43
PM
Subject: Re: possible idiot
question
Hi
Shivaraj...
thanks for your patience on this one... i'm gonna run
down what i know that i've got now...
the
two classes contained in this mail (below) are both in the same
directory....
C:\Program Files\Jakarta Tomcat
4.0\webapps\begjsp-ch07\WEB-INF\classes\com\wrox\library
the
first class Book compiles without a hitch, but the subclass ChildrensBook is
still giving me grief...
when
attempting to compile it through forte I get...
WEB-INF/classes/com/wrox/library/ChildrensBook.java [3:1] Class Book not found
in type declaration or import. public class
ChildrensBook extends Book
{
^ 1 error
and
when trying the same through the console, with the command: javac
ChildrensBook.java
I
get....
ChildrensBook.java:3: cannot
resolve symbol symbol : class
Book location: class
classes.com.wrox.library.ChildrensBook public class
ChildrensBook extends Book
{
^ 1 error
i
have also set my CLASSPATH, under environment variables to
...
C:\Program Files\Jakarta Tomcat
4.0\webapps\begjsp-ch07\WEB-INF\classes
please if you gotten to the end of this mail, could
you shed some light on my predicament, as i am really beginning to tear my
hair out here
cheers
ewan
u can set your classpath in project -->
setting --> servlet jsp --> expert tab . First make sure u r
tomcat is running or not
----- Original Message -----
Sent: Monday, September 24, 2001 5:53
PM
Subject: Re: possible idiot
question
thanks for you reply...
i feel i may be getting somewhere now that
someone has pointed out the things that are right..
my classes are stored in the webapps folder of
tomcat under the directory...
webapps\begjsp-ch07\WEB-INF\classes\com\wrox\library\
does this tally with my package declaration?
i am unclear as to where the classpath is
defined, and what it should contain... (any suggestions?) there will be
many more classes within this pakage by the time i have finished this
section of the tut.
thanks again shivaraj
cheers
ewan
1) Where r u stroing your classes? If u r
classes are in com.wrox.library then what r u doing right. But i
think u have to check u r classpath and have it pointing
to directory which is containing com package.
2) If u just want to use that package, just
import that package instead of declaring a package. and com.wrox.library
should be in u r classpath.
happy coding
----- Original Message -----
Sent: Monday, September 24, 2001
4:48 PM
Subject: Re: possible idiot
question
thanks very much for you reply, but i think
that is what i have done with the declaration...
package com.wrox.library;
in both of the classes, as i understand it a
package is euphanism for directory, would that be
correct.
as you will gather this is a wrox
tut
i have pasted the code below for anyone who
is interested:
initial class:
*******************************************************
package com.wrox.library;
public class Book {
private String
title; public String
getTitle() { return
title; }
public void setTitle (String title)
{ this.title =
title; }
/** Creates new Book: Constructor
*/ public Book () {
} public Book (String
title) { this.title =
title; }
}
*******************************************************
extension class:
*******************************************************
package com.wrox.library;
public class ChildrensBook extends Book
{
private int
minimumAge; public int
getMinimumAge() { return
minimumAge; }
public void setMinimumAge(int a)
{ minimumAge =
a; }
public ChildrensBook()
{
super(); }
public ChildrensBook(String title)
{
super(title); } }
*******************************************************
once again thanks to anyone who is willing to
assist me...
ewan
taylor
In both classes u have to declare the
package to which that class belong. That may solve u r
problem.
happy coding
----- Original Message -----
Sent: Monday, September 24,
2001 4:27 PM
Subject: possible idiot
question
i am
trying to get my head around class inheritance and have followed
some tuts, however....
having
created a simple class, and then creating a subclass, extending
the first, i keep getting
Class Book not
found in type declaration or import...
when i
try to compile it, they are both sitting in the same package....
pls help!! this is giving me a headache.
i am
currently running Sun's Forte IDE with JDK1.3.1 and serving it up
with Tomcat 4.0
forte
suggests that i have an invalid package declaration but i can find
no documentation on how to rectify this, and am baffled as i have
followed the tuts to the letter and nothing seems out of
kilter.
any
help will be gratefully recieved...
cheers..
ewan
taylor ========================= To
unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST". For digest: mailto [EMAIL PROTECTED] with body:
"set JSP-INTEREST DIGEST". Some relevant FAQs on JSP/Servlets can
be found at: http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=P
http://www.jguru.com/jguru/faq/faqpage.jsp?name=rvlets
========================= To unsubscribe:
mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". For
digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST". Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=P
http://www.jguru.com/jguru/faq/faqpage.jsp?name=rvlets
========================= To unsubscribe: mailto
[EMAIL PROTECTED] with body: "signoff JSP-INTEREST". For digest:
mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST". Some
relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=P
http://www.jguru.com/jguru/faq/faqpage.jsp?name=rvlets
========================= To unsubscribe: mailto
[EMAIL PROTECTED] with body: "signoff JSP-INTEREST". For digest: mailto
[EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST". Some relevant FAQs
on JSP/Servlets can be found at: http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=P
http://www.jguru.com/jguru/faq/faqpage.jsp?name=rvlets
|