Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2007

Tip: Looking for answers? Try searching our database.

Where to copy servlet.jar?

Thread view: 
Sathyaish - 29 Mar 2007 15:04 GMT
I am a Java newbie. I am learning how to program Servlets and JSPs.
The tutorial I have currently read is here:

http://www.apl.jhu.edu/~hall/java/Servlet-Tutorial/

I have two questions in this regard. This page (http://www.apl.jhu.edu/
~hall/java/Servlet-Tutorial/) of the tutorial says that I need to put
two files, namely servlet.jar and jsp.jar into the CLASSPATH.

1. I have been able to find only servlet.jar. I do not know where to
find jsp.jar.

2. I am not sure where I must copy the servlet.jar file. I have the
Java 1.4 SDK. I do not want to install the latest 1.6.x SDK because
many of the other tools I have to learn to use make use of the 1.4
version.

JDK is currently installed on my computer at the following location: C:
\Program Files\Java\j2re1.4.2_13\

The contents of the folder are:

bin\
javaws\
lib\
license files
readme.txt

I have JRE installed at the following location: C:\Program Files\Java
\jre1.6.0

lib\ext\QtJava.zip
Uwe Plonus - 29 Mar 2007 15:30 GMT
> I am a Java newbie. I am learning how to program Servlets and JSPs.
> The tutorial I have currently read is here:

Please learn Java first before trying the advanced topics.

A good beginning point for learning Java is the Java tutorial at the sun
web site.

There you will learn things like setting up your Java environment which
is necessary to use advanced topics like servlet programming or J(2)EE.

Uwe
Sathyaish - 29 Mar 2007 15:44 GMT
> Please learn Java first before trying the advanced topics.
>
[quoted text clipped - 5 lines]
>
> Uwe

Thanks, Uwe. I am trying to learn both simultaneously. I think you are
right. I'll stop and read the Java tutorials first.
Lew - 29 Mar 2007 22:50 GMT
> I have two questions in this regard. This page (http://www.apl.jhu.edu/
> ~hall/java/Servlet-Tutorial/) of the tutorial says that I need to put
> two files, namely servlet.jar and jsp.jar into the CLASSPATH.

This happens automatically when you install Tomcat or another servlet container.

> 1. I have been able to find only servlet.jar. I do not know where to
> find jsp.jar.

Install Tomcat.

> 2. I am not sure where I must copy the servlet.jar file. I have the
> Java 1.4 SDK. I do not want to install the latest 1.6.x SDK because
> many of the other tools I have to learn to use make use of the 1.4
> version.

The Java 6 JVM is almost completely compatible with 1.4 code. It's the other
way around that causes trouble. You might run into difficulty with code that
uses "enum" or "assert", but you can always compile the code "javac -target
1.4" to remove that incompatibility while using Java 6.

Java 1.4 is really old. Java 5 is already almost two and a half years old. You
should upgrade.

-- Lew
Tom Hawtin - 30 Mar 2007 01:47 GMT
> The Java 6 JVM is almost completely compatible with 1.4 code. It's the
> other way around that causes trouble. You might run into difficulty with
> code that uses "enum" or "assert", but you can always compile the code
> "javac -target 1.4" to remove that incompatibility while using Java 6.

And "-source 1.4" to get javac to even start to work. Then you probably
get an error at runtime saying something along the lines that
StringBuffer append(StringBuffer) does not exist. So you also need
something like "-bootclasspath /usr/java/j2re1.4.2_13/lib/rt.jar"

> Java 1.4 is really old. Java 5 is already almost two and a half years
> old. You should upgrade.

Yay! But they wont listen...

Tom Hawtin
Lew - 30 Mar 2007 02:00 GMT
Lew wrote:

>> The Java 6 JVM is almost completely compatible with 1.4 code. It's the
>> other way around that causes trouble. You might run into difficulty
>> with code that uses "enum" or "assert", but you can always compile the
>> code "javac -target 1.4" to remove that incompatibility while using
>> Java 6.

> And "-source 1.4" to get javac to even start to work. Then you probably
> get an error at runtime saying something along the lines that
> StringBuffer append(StringBuffer) does not exist. So you also need
> something like "-bootclasspath /usr/java/j2re1.4.2_13/lib/rt.jar"

That's an example of trying to run J6 classes on a 1.4 engine, isn't it?  The
bootclasspath is only needed if you're running stuff on an older JVM.  I was
speaking of running J 1.4 classes on a J6 engine, which does have
StringBuffer's append(StringBuffer) method but won't see it in the older classes

The J6 'javac' should work fine on 1.4 source with the '-source 1.4' option.

The point I was addressing was:
> I do not want to install the latest 1.6.x SDK because
> many of the other tools I have to learn to use make use of the 1.4
> version.

Those tools should run fine under a J6 engine.

-- Lew


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.