File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

can not compile servlet

 
Jo Lee
Ranch Hand
Posts: 35
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have j2sdk1.4.0beta3 and tomcat 3.2 installed on my windows xp home edition machine. I have followed the instruction of puting servlet.jar from the tomcat library to my classpath, but still get problem compile my servlet. The package javax.servlet.* and javax.servlet.http.* is still not recognized. My JAVA_HOME is point to the j2sdk1.4.0 installation. What else is missing?

Any help is highly appreciated.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13049
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since the servlet API is a standard extension, the jar file should go in wherever Java 1.4 keeps standard extensions.
Personally, I have converted to the ANT utility for development because you can exactly specify the classpath to the compiler instead of depending on the system environment settings.
Bill
 
Jo Lee
Ranch Hand
Posts: 35
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply. I am very new to this, how do one use the Ant utitlity? Do I have to set up some parameter somewhere?
Thanks
Jo
 
Steven Kors
Ranch Hand
Posts: 33
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Set your class path to the Servlet Jar and dont for get to add this ..
;.;
Hope that helps
 
Jo Lee
Ranch Hand
Posts: 35
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mercery_Steel;
Thanks very much.
In my classpath, the first bit is a .; followed that is the path to the various lib files. I just realized that I had j2sdk1.4beta-3 and Jbuilder5 and tomcat3.2 installed on the computer. The Jbuilder5 is jdk1.3, I wonder if that is the problem. Can you help?
Jo
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13049
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The ANT utility is a bit hard to get started with but study will pay off. There is a rather complete set of documentation with the download.
You can get it at jakarta.apache.org.
ANT works entirely from a build.xml file that specifies environment variables and related parameters that can override your classpath settings. This makes it much easier to keep your classpath simple - particularly with an environment like yours having multiple JDKs installed.
Bill
 
Roseanne Zhang
Ranch Hand
Posts: 1953
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Steven, I love your signature!
I agree with Bill's comments on ant. Hard to start and absolutely worth it.
Need Java real project experience? Join our project team here!
 
Steven Kors
Ranch Hand
Posts: 33
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Roseanne,
Thank you

Jo Lee,
Can you post in detail what your problem is? For example could you copy and paste your error being generated and what you are using as a developement environment etc, please . A complete picture of your development environment would help in determining why you cannot compile.
Side Note: JBuilder should allow you to change your JDK. I use Visual CafeEE so unfortunately i dont know the ins and outs of JBuilder.
[ February 04, 2002: Message edited by: Steven Kors ]
 
Jo Lee
Ranch Hand
Posts: 35
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for all your helpful replies.
on Windows XP machine, I have j2sdk1.4.0-beta3 installed and recently installed tomcat3.2 on top of it. In addition, I have JBuilder5 installed which uses jdk1.3, I will try to find out how to change jdk in jbuilder5. And I will also start to learn ANT. Just now, I have JBuilder6 installed.
Thanks again.
Jo
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JBuilder lets you configure multiple JDKs.

Both 5 & 6 are the same for this topic.

Tools|Configure JDKs
Click "New" and browse to the 'home' of the jdk you want to configure.

Then on a project by project basis, go to
Project|Project Properties
and the first tab (Paths), first text box (JDK) lets you set a new JDK for that project, from the list you previously set up under the Tools|Configure JDKs menu.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic