Go Back   CodingForums.com > :: Server side development > Java and JSP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-02-2004, 07:31 PM   PM User | #1
weronpc
Regular Coder

 
Join Date: Apr 2003
Location: Canada, Ontario, Mississauga
Posts: 312
Thanks: 0
Thanked 0 Times in 0 Posts
weronpc is an unknown quantity at this point
Javac not working at coreservlets

I compile my HelloServlet3.java and ServletUtilities.java fine in other directory, but it will not compile in this directory:
/usr/local/tomcat/webapps/ROOT/WEB-INF/classes/coreservlets

It gave me this error:
[root@localhost coreservlets]# javac HelloServlet3.java
HelloServlet3.java:23: cannot resolve symbol
symbol : variable ServletUtilities
location: class coreservlets.HelloServlet3
out.println(ServletUtilities.headWithTitle(title) +
^
1 error

It is not the code error because it works on other directory.
weronpc is offline   Reply With Quote
Old 03-02-2004, 08:16 PM   PM User | #2
Spookster
Supreme Overlord


 
Spookster's Avatar
 
Join Date: May 2002
Location: Marion, IA USA
Posts: 6,220
Thanks: 4
Thanked 80 Times in 79 Posts
Spookster will become famous soon enough
are you importing anything into that class that does not reside in that directory?
__________________
Spookster
CodingForums Supreme Overlord
All Hail Spookster
Who gave you that Ugging infraction? Yeah that's right it was me!
Spookster is offline   Reply With Quote
Old 03-02-2004, 08:24 PM   PM User | #3
weronpc
Regular Coder

 
Join Date: Apr 2003
Location: Canada, Ontario, Mississauga
Posts: 312
Thanks: 0
Thanked 0 Times in 0 Posts
weronpc is an unknown quantity at this point
both HelloServlet3.java and ServletUtilities.java are in the same diretory,


HelloServlet3.java =>
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

ServletUtilities.java =>
import javax.servlet.*;
import javax.servlet.http.*;

The error saying HelloServlet3 doesn't know where the method ServletUtilities.headWithTitle("string") . So, it doesn't know where the ServletUtilities.class is to.

my CLASSPATH conatins the . (current dir)
weronpc is offline   Reply With Quote
Old 03-03-2004, 08:59 AM   PM User | #4
shmoove
Regular Coder

 
Join Date: Dec 2003
Posts: 367
Thanks: 0
Thanked 0 Times in 0 Posts
shmoove is an unknown quantity at this point
If you're compiling directly from the directory that contains those two files, then it will have problems because they are declared to be in a package called coreservlets, so it will look for them in a subdirectory called coreservlets. So you should compile from the directory that contains the coreservlets subdirectory (the root source directory).

shmoove
shmoove is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:36 PM.


Advertisement
Log in to turn off these ads.