As I'm sure you've noticed, there are still people posting asking how to
get their Java programs compiled to work on MS JVM. My question is why
do people want this?
I'll give an answer somewhat different from that of
either Mickey or Tim..
Take this applet as a 'for instance'..
<sscce>
public class HelloWorldApplet
extends java.applet.Applet {
public void init() {
add( new java.awt.Label("Hello World!") );
}
}
</sscce>
You would expect (hope) that this applet works just fine
in 1.1 - it uses nothing that was not available in 1.1.
One of the few practical ways for most people to *test* that
is to point one of the (dwindling number of) Internet Explorer
browsers armed with the MSVM. It is true that you can still
get versions of NN 4.78 with Symantec's Java 1.1.5, but the
MSVM is even earlier, at 1.1.4.
So the MSVM is the one of the best ways to test *1.1* compatibility,
1) I argue the question is in part, not 'making applets for the MSVM'
so much as 'making applets compatible with 1.1'.
Now consider this source..
<sscce>
import java.awt.*;
public class ImageApplet
extends java.applet.Applet {
Image image;
public void init() {
java.net.URL imageURL =
this.getClass().getResource("bird.gif");
image = getImage(imageURL);
// do lots of calculations
// and component initialisation..
}
public void paint(Graphics g) {
g.drawImage(image,0,0,null);
}
}
</sscce>
Should *this* code work in 1.1?
Yes and no. It is fragile for the fact that the image
may not be loaded by the time of the first 'paint'.
I was dealing with an applet that worked in every VM
this side of the MSVM (including the NN Symantec 1.1.5 VM),
yet broke in the MSVM because the MSVM was able to get
through the initialisation faster than the image took to load.
So - again there are good reason for testing applets in
the MSVM specifically - there are some things it does
better, and faster than any other VM that I know of.
..If it is for applets, why not use the Sun java
plug-in?
As both Tim and Mickey have touched on, if it is a
business critical applet, the tendency is to make
it compatible with as many comers as possible, which
leans heavily towards 1.1/AWT.
AaaaaAAAAArrgh! That /abomination/?!?
Only recently have Sun themselves seen the idiocy of
the 'All browsers' template for the HTMLConverter
that was churning out hundreds (thousands) of web
pages using Sun's own incredibly poor excuse for
Javascript (Browser sniffing JS - the worst kind).
Now they recommend the template that simply writes
that same text as HTML directly into the page, and
triggers HTML validation errors because of the use
of the non W3C said:
..or <jsp
lugin>, HTML code is generated
that downloads and installs the plug-in if it does not exist. Are there
other reasons I am not aware of?
Java major versioning can be done for applets
using the JavaVersionApplet[1] more complex
deployment and versioning can be done with
JWS (for which the <applet> element does just fine).
[1] <
http://www.physci.org/codes/jre.jsp>
Having said all that, I should add that
- My perception is skewed because I write so many
applets that *must* work with 1.1 to be of use
(mostly support applets for other applets)
- My perception is further skewed because I deal with
so many people new to Java, and developing applets, who
have yet to start using Swing.
- I feel that the number of people actually using 1.1,
who are willing to part with cash over the internet,
is miniscule, and that it is no longer worth jumping
through hoops to accomodate those who will not, or
cannot update.