Mulugeta Maru

Ranch Hand
+ Follow
since Jan 20, 2003
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Mulugeta Maru

Yes. Thank you for you help. The problem is the way the class path is set up. I made changes to the class path and it works.

Maru
20 years ago
I am rather confused about this issue. I was able to compile the folllowing code:



When I try to run it I get above error. Any idea why?

My class pathe is set as follows:



Thank you for you help.

Maru
20 years ago
Yes it is a CLASSPATH problem.I made changes to the CLASSPATH and it now works perfectly.

Thank you for your kind help.

Maru
20 years ago
I am not sure my CLASSPATH is properly set.

20 years ago
The error message I am getting is that of cannot resolve symbol. I have to class as show below and when I try to compile ClickMe.java I get the error message:

clickme.java:6: cannot resolve symbol
symbol : class Spot
location: class ClickMe
private Spot spot = null;

clickme.java:28: cannot resolve symbol
symbol : class Spot
location: class ClickMe
spot = new Spot(RADIUS)
2 errors





Please note that I have no problem compiling a single class i.e. a class that does not refere to another class.

It is my understanding that when I compile ClickMe it automatically compiles Spot.

Thank you for you help.

Maru
20 years ago
Thank you. You may be right to point out that it may be a CLASSPATH issue. I am getting package javax.servlet does not exist etc.
This is how I set-up my class path:

The two java programs I am trying to compile are in ...\webapps\ATS\WEB-INF\classes directory.
I am not sure whether my set-up is right.
What is not clear for me is that when I try to compile Help.java it does compile without an error. What is going on?
Regards,
Mulugeta
20 years ago
I still get the same error message. It does not make sense at all. I can compile Help but not Hello, because referece to Help. Both files are in the same directory. When I try to compile Hello, javac should have compile both automatically, because they are in the same folder.
When I use BlueJ no problem. It is only when I try to do it on a command line.
Thank you for you help.
Maru
20 years ago
I must say thank you for trying to help me on this frustrating issue. I did change and now have the flowing code, which does give me the same error. I am not sure why. I did run the same code using BlueJ and it did compile no problem. I do not know why it does not compile when I do it at the command prompt. Any thoughts on this. I have not really used the command line very much. I am probably spoiled using BlueJ.


Regards,
Maru
20 years ago
Sorry I did not respond on time. The error message is as follows:
hello.java:12: cannot resolve symol
symbol : variable help
location: class Hello
out.println(help.headWithTitle(title) +
I can compile help with no problem. It is when I try to compile hello the above error message is issued.


Regards,
Maru
20 years ago
I did change help.java to ServletUtilities.java and the reference in Hello.java. I still can not compile Hello java. I can compile ServletUtilities no problem. Since this two files are in the same folder it should not have been a problem.
Any idea why I can not compile Hello.java?
Regrards,
Maru
20 years ago
Sorry for not including the code:

Regrards,
Maru
20 years ago
I am trying to compile hello.java that uses help.java and both of them are in the same directory. I can comile help but when I try to compile hello.java I get the following error message:
cannot resolve symbol
symbol : variable help
location: class hello
Your help is appreciated.
Regards,
Maru
20 years ago
I added the %CATALINA_HOME%\webapps\ATS\ WEB-INF\classes directory to my classpath and it works.
Thank you very much for your clear answer to my question.
Regards,
Maru
20 years ago
I am sorry. How do I use tags? I never tried it before and please forgive me if it caused a problem.
Regrards,

Maru
20 years ago
In the past I did not have to deal with packages. Now I do and need you help please.
The class path is set as follows in autoexec.bat:
set PATH=%PATH%;F:\j2sdk1.5.0\bin
set JAVA_HOME=F:\j2sdk1.5.0
set CATALINA_HOME=F:\Tomcat5
set CLASSPATH=%CLASSPATH%;%CATALINA_HOME%\common\lib\servlet-api.jar
cd %CATALINA_HOME%\webapps\ATS\ WEB-INF\classes\wrox
Both my classes are in the wrox directory and one of them refers the other. When I run (at the command prompt F:\Tomcat5\webapps\ATS\WEB-INF\classes\wrox javac HelloWWW3.java) the one that refers the other both of them should be compiled automatically but instead I get an error:
Cannot find symbol variable ServletUtilities
Location wrox.HelloWWW3
out.println(ServletUtilities.headWithTitle(title)
HelloWWW3:
package wrox;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class HelloWWW3 extends HttpServlet
{
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
response.setContentType("text/html");
PrintWriter out = response.getWriter();
String title = "Hello WWW again";
out.println(ServletUtilities.headWithTitle(title) +
"<BODY>\n" +
"<H1>Hello WWW</H1>\n" +
"</BODY></HTML>");
}
}
ServletUtilities:
package wrox;
import javax.servlet.*;
import javax.servlet.http.*;
public class ServletUtilities
{
public static final String DOCTYPE =
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 " +
"Transitional//EN\">";
public static String headWithTitle(String title)
{
return(DOCTYPE + "\n" +
"<HTML>\n" +
"<HEAD><TITLE>" + title + "</TITLE></HEAD>\n");
}
}
Please note that I have no difficulty compiling code that does not refer to a custom class. For example I was able to run ServletUtilites and it did compile with no problem. Your help is very much appreciated.
Maru
20 years ago