| Author |
How to set Servlet classpath in Tomcat temporarily?
|
Yohan Weerasinghe
Ranch Hand
Joined: Oct 07, 2010
Posts: 485
|
|
Hi,
I just want to know how to set the servlet class path in tomcat temporarily.. Now I am usig environment variables, but I am happy to set classpath temporarily. This is my Servlet location.
C:\TomCat\lib\servlet-api.jar
Then I like to know, for how long this classpath will exist.
Please help
|
Are you better than me? Then please show me my mistakes..
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56192
|
|
Is this for run time or for compile time?
If the former, Tomcat doesn't use the classpath at all so it's not an issue. If for compile time, then using the servlet jars are just like using any other jars.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Yohan Weerasinghe
Ranch Hand
Joined: Oct 07, 2010
Posts: 485
|
|
Hi Bear Bibeault,
Yes, this is for the compilation. I set the classpath using environment variables but that is not what I need now. I heard there is a way to set the class path temporarily using CMD. How to do that and for how long that path will last?
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
|
|
|
How about javac -cp C:\TomCat\lib\servlet-api.jar;. ..., with the ... replaced with your regular compiler flags and arguments?
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
Yohan Weerasinghe
Ranch Hand
Joined: Oct 07, 2010
Posts: 485
|
|
Rob Spoor wrote:How about javac -cp C:\TomCat\lib\servlet-api.jar;. ..., with the ... replaced with your regular compiler flags and arguments?
Hi! Thanks for the comment. Anyway what about "set classpath ;C:\TomCat\lib\servlet-api.jar" ???
I am trying to use this way because when I set the PERMANENT classpath, all other non web based java programs I created wont run. The simply simply throws "Cannot find File" or something like that. This is not happening only to me, happening to everyone of us in our class, and has happened to all my 3 computers.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56192
|
|
|
As this is about compiling and not really about servlets or Tomcat, it's been moved to a more appropriate forum.
|
 |
Yohan Weerasinghe
Ranch Hand
Joined: Oct 07, 2010
Posts: 485
|
|
Bear Bibeault wrote:As this is about compiling and not really about servlets or Tomcat, it's been moved to a more appropriate forum.
Thanks for the help Bear Bibeault.. I really appreciate it...
So, anyone have any more ideas?
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32687
|
|
You can often do more harm than good by setting a system classpath.
Can’t you set a classpath by writing set CLASSPATH=.;c:\etc at the command line? Then you have a classpath for your current session, which will vanish when you close the command line.
|
 |
Yohan Weerasinghe
Ranch Hand
Joined: Oct 07, 2010
Posts: 485
|
|
Campbell Ritchie wrote:You can often do more harm than good by setting a system classpath.
Can’t you set a classpath by writing set CLASSPATH=.;c:\etc at the command line? Then you have a classpath for your current session, which will vanish when you close the command line.
Finally, the answer I am seeking for... .. Thanks for the help.. Please do me some more favor. Could you please write the complete command? I have given the path of my jar files. Then I can coppy and paste your command and stay away from trouble. Please help..
|
 |
 |
|
|
subject: How to set Servlet classpath in Tomcat temporarily?
|
|
|