File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes compiling servlets and jsp and running in tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "compiling servlets and jsp and running in tomcat" Watch "compiling servlets and jsp and running in tomcat" New topic
Author

compiling servlets and jsp and running in tomcat

Irfan Junedi
Greenhorn

Joined: Mar 30, 2008
Posts: 13
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

Joined: Dec 11, 2004
Posts: 13410

Tomcat compile your Java classes for you.
You have to do that yourself.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Irfan Junedi
Greenhorn

Joined: Mar 30, 2008
Posts: 13
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

Joined: Dec 11, 2004
Posts: 13410

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

Joined: Mar 30, 2008
Posts: 13
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

Joined: Dec 11, 2004
Posts: 13410

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

Joined: Dec 11, 2004
Posts: 13410

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

Joined: Mar 28, 2004
Posts: 257

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?


Amit Tank
Linked In
Irfan Junedi
Greenhorn

Joined: Mar 30, 2008
Posts: 13
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....
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: compiling servlets and jsp and running in tomcat
 
Similar Threads
which jar file for classpath ?
tomcat
problem with jstl
servlet compiling
Servlet question