Where to copy servlet.jar?

S

Sathyaish

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
 
U

Uwe Plonus

Sathyaish said:
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
 
S

Sathyaish

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


Thanks, Uwe. I am trying to learn both simultaneously. I think you are
right. I'll stop and read the Java tutorials first.
 
L

Lew

Sathyaish said:
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
 
T

Tom Hawtin

Lew said:
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
 
L

Lew

Tom said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top