File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

cannot compile servlet code

 
northfield Sid
Ranch Hand
Posts: 106
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I cannot compile Servlet files on my WinXP environment.
my servlet.jar file is located at
c:\tomcat\jakarta-tomcat-3.3.1\common\lib\servlet.jar
what shall I do?
The error messages are only for servlet portion of code?
 
Engin Okucu
Ranch Hand
Posts: 174
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
did you point your classpath to 'c:\tomcat\jakarta-tomcat-3.3.1\common\lib\servlet.jar' ?
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13048
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have taken the plunge and gone entirely to using ANT when compiling servlets and any other applications that requires more than the standard library. ANT makes it so easy to create those special classpaths and you don't have to screw up your environment variables. It also makes it easy to switch back and forth between versions of libraries.
Yes ANT has a learning curve, but you will be glad you did. Many open source projects just routinely include ANT build.xml files.
Bill
 
northfield Sid
Ranch Hand
Posts: 106
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In XP you can set the path by rightclicking on my computer - then go to environment vairables and edit the path but I cannot see any for classpath???
What is the easist way yo use the class path?
----------------------------------------------
Thanks Brogdan,
I want to read ANT, but as you said there is a learning curve, so I think I will do in a months time.
 
Philip Shanks
Ranch Hand
Posts: 189
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I see this "classpath" solution offered up quite frequently, but to be honest, I've never set a CLASSPATH environment variable on any windoze machine that I have used, and I don't have any problems compiling. I do set JAVA_HOME to point to the J2SDK install directory, which I always put on a partition root, with no spaces in the folder name.
Could you describe your environment in a bit more detail?
Are you compiling from the command line?
If so, did you add a copy of servlet.jar to %JAVA_HOME%\jre\lib\ext\ ?
If not, are you using the proper command line flags and arguments to specify classpath and target directory, etc?
Are you compiling from within another Java environment, say perhaps jEdit or Netbeans?
If jEdit, did you set the classpath in the editor config?
If you're using Netbeans, then you shouldn't be having any problems with this... suggest re-installing Netbeans.
PCS
[ November 08, 2002: Message edited by: Philip Shanks ]
 
northfield Sid
Ranch Hand
Posts: 106
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
>Are you compiling from the command line?
Yes.
>If so, did you add a copy of servlet.jar to %JAVA_HOME%\jre\lib\ext\ ?
No, but I have now, and it works.
I have in previous occasions installed classpath but on latest installations have not since I was advised by many from the forum not to.
Thanks
I will also be hopefully be learning ANT very soon.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic