This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Servlets and the fly likes problem compiling Servlets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Servlets
Bookmark "problem compiling Servlets" Watch "problem compiling Servlets" New topic

problem compiling Servlets

Anil Jain
Ranch Hand

Joined: Mar 10, 2002
Posts: 51
my java complier is in
the servlet class is in
the servlet.jar is in
I have set the CLASSPATH file for servlet.jar
Now my problem is that since the javac (the complier is in different directory how do i compile the servlet
Any info?

Anil Jain<br />Sun Certified Java(2) Programmer
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1179

If you add 'c:\jdk1.3\bin' to the PATH then you can call javac from any location in the file structure.

Regards, Rene Larsen
Dropbox Invite
Roy Ben Ami
Ranch Hand

Joined: Jan 13, 2002
Posts: 732
do what i always do to avoid this all path issue:
copy the servlet.jar to this directory:
you get the idea (although your directory structure may be a little different).
Anil Jain
Ranch Hand

Joined: Mar 10, 2002
Posts: 51
Hello Rene and Roy!!
Rene i could use the PATH variable successfully thanks for your help.
Roy if i m not wrong that you want me to put the servlet.jar file in jdk directory so that whenever i import any javax classes the compiler can easily access thru servlet.jar in the same directory.
Correct me if i m wrong in getting this point.
Thanks Again,
Roy Ben Ami
Ranch Hand

Joined: Jan 13, 2002
Posts: 732
you got it
all external classes you get, including the servlet.jar classes, you can put in the ext directory i showed you.
then the java compiler finds them automatically without needing the classpath commands.
subject: problem compiling Servlets
It's not a secret anymore!