File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes how to compile java file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "how to compile java file" Watch "how to compile java file" New topic

how to compile java file

Sabber bhatia
Ranch Hand

Joined: Jun 27, 2006
Posts: 59
hello everyone

i am not being able to complie java file having java.servlet.http.*
i installed jdk 1.5,jre for that and tomcat
please tell me what is the problem

Sabeer bhatia
Vishal Matere
Ranch Hand

Joined: Jan 22, 2008
Posts: 81
servlet-api.jar needs to be in classpath.
Can you please be very specific if it's java.servlet.http or JAVAX.servlet.http ?

[ April 22, 2008: Message edited by: Vishal Matere ]

SCJP <br />SCWCD <br />SCBCD <br />SCEA-1
Vilmantas Baranauskas
Ranch Hand

Joined: Dec 20, 2006
Posts: 89
First, to compile java sources, you need jdk, not jre.

Second, it is javax.servlet.http.*, not java.servlet.http.*.

Third, how do you try to compile it - command line or IDE?

In any case, you need to include servlet-api.jar in your classpath. It can be found at tomcat/common/lib/servlet-api.jar.

Author of <a href="" target="_blank" rel="nofollow">NewsInjector</a>
I agree. Here's the link:
subject: how to compile java file
It's not a secret anymore!