It's not a secret anymore!
The moose likes Servlets and the fly likes Not able to compile servlets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Not able to compile servlets" Watch "Not able to compile servlets" New topic

Not able to compile servlets

Meenakshi Sriram

Joined: Nov 30, 2005
Posts: 3
Hi all,

I am new to this forum. I am in the beginning stage of tsudying servlets. O downloaded tomcat apache 5.0 and installed properly. (I was not able to starup the server and when i added java_home environment variable it started properly).
The whole problem is I am not able to compile my servlets. I have set my CLASSPATH and JAVA_HOME environment variable in the system properties of windows XP.
CLASSPATH = .;c:\program files\apache...\tomcat 5.0\common\servlet-api.jar
JAVA_HOME = C:\program files\java\j2sdk1.4.2_10
I am trying to compile my file in the dos prompt
c:\program files\apache...\tomcat 5.0\webapps\jspbook\WEB-INF\classes\com.\.\HelloWorld.Java
I am not able to figure out where I going wrong can anyone please help me.
Any type of advice is welcome.Thanks in advance
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63343

Helpful hint #1

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

One helpful detail would be the compiler error

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Prabodh Reddy

Joined: Dec 19, 2005
Posts: 14
Which Operating System u r using?
at the command prompt type
echo %classpath%
you will see wheter classpath is set to the corresponding jars of the servlet and JDK.
I agree. Here's the link:
subject: Not able to compile servlets
jQuery in Action, 3rd edition