> Please learn Java first before trying the advanced topics.
>
[quoted text clipped - 5 lines]
>
> Uwe
> 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