aspose file tools*
The moose likes Servlets and the fly likes can not compile servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "can not compile servlet" Watch "can not compile servlet" New topic
Author

can not compile servlet

Jo Lee
Ranch Hand

Joined: Jun 26, 2001
Posts: 35
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

Joined: Mar 22, 2000
Posts: 12769
    
    5
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

Joined: Jun 26, 2001
Posts: 35
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

Joined: Jan 30, 2002
Posts: 33
Set your class path to the Servlet Jar and dont for get to add this ..
;.;
Hope that helps


Thanks,
Steven
Jo Lee
Ranch Hand

Joined: Jun 26, 2001
Posts: 35
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

Joined: Mar 22, 2000
Posts: 12769
    
    5
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

Joined: Nov 14, 2000
Posts: 1953
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

Joined: Jan 30, 2002
Posts: 33
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

Joined: Jun 26, 2001
Posts: 35
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

Joined: Feb 20, 2001
Posts: 3695

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.
 
Consider Paul's rocket mass heater.
 
subject: can not compile servlet