• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

compiling servlets and jsp and running in tomcat

 
Irfan Junedi
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have installed tomcat5.5.26 in windows,now i want to know how to set new classpath and which files i need to import and place in which folders so as to compile my servlet and jsp programs..
I have used Sunappserver previously to compile servlet and jsp by setting path till .......j2ee.jar
Now i want to work with tomcat so please help me and answer me in detail..
Waiting for responses..


 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tomcat compile your Java classes for you.
You have to do that yourself.
 
Irfan Junedi
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
dear sir,
It is giving me an error that package javax.servlet does not exist because i am pointing to jdk in my classpath..
I want the new one which i want to set in environment variables.
Please Ben i appreciate your presence..and tell me the answer...

 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See:
http://faq.javaranch.com/java/CompilingServlets

If you're not used to setting classpaths or using javac, let me know and I'll ask to have this thread moved to our Java In General (Beginner) forum where these things are usually covered.
 
Irfan Junedi
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
dear sir,
i want steps to set classpath so that my servlet get compilied..I know how to deploy on tomcat but the thing is compiling servlet..
I appreciate your presence MR.Ben

And its 1.20 am here i want to compile this servlet nd sleep
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And its 1.20 am here i want to compile this servlet nd sleep


Heheh.
Let me see if I can get this moved to our Java In General forum where you'll get lots of help compiling your class so you can sleep.

-Ben
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What have you done to set your classpath so far?

Have you added servlet-api.jar to it?
The servlet-api.jar file can be found in tomcat/common/lib (or if you're using Tomcat 6: tomcat/lib).

How are you trying to compile your servlet classes?



See this FAQ for help pasting environment variables, etc.. into the ranch:
http://faq.javaranch.com/java/HowToCopyEnvironmentVariablesAndDirectoryStructures
[ May 05, 2008: Message edited by: Ben Souther ]
 
Amit M Tank
Ranch Hand
Posts: 257
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

And its 1.20 am here i want to compile this servlet nd sleep


Were you able to sleep, oops I mean compile the code?
 
Irfan Junedi
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
dear ben,
I have set my environment variables like this
catalina_home as C:\Program Files\Apache Software Foundation\Tomcat 6.0
java_home as c:\progarm files\java\jdk
path as c:\program files\java\jdk\bin
classpath as C:\program files\java\jdk\lib;C:\program files\java\jdk\lib;C:\Program Files\Apache Software Foundation\Tomcat 6.0\lib\servlet-api.jar.

so any changes to be done to this,i am getting the same error
package does not found....
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic