*BSD News Article 77528


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!news.mira.net.au!news.vbc.net!alpha.sky.net!newshub.cts.com!news7.crl.com!nntp.crl.com!howland.erols.net!cam-news-hub1.bbnplanet.com!news.mathworks.com!newsfeed.internetmci.com!in3.uu.net!ott.istar!istar.net!van.istar!west.istar!news-w.ans.net!newsfeeds.ans.net!lantana.singnet.com.sg!chenab.lums.edu.pk!chenab.lums.edu.pk!not-for-mail
From: aslam@lums.edu.pk (Sohail Aslam)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Netscape 3.0 doesn't reload .class file even recompiled
Date: 30 Aug 1996 11:56:57 +0500
Organization: Lahore University of Management Sciences (LUMS)
Lines: 48
Message-ID: <5063bp$n7c@chenab.lums.edu.pk>
NNTP-Posting-Host: chenab.lums.edu.pk


I wrote the hello world applet and viewed it with Netscape 3.0 on a 
FreeBSD machine running Xwindows. The applet runs fine and prints
"Hello World". I then went back and changed the string to "Hello Java World",
recompiled the .java file using kaffe on the FreeBSD machine and told
Netscape to reload the html file containing the applet. When it did, 
I saw the "Hello World" string and not the new one. I cleared the disk
and memory cache and reloaded but the old string shows up. I changed the
file name of the .class file, made the corresponding change in the .html
file, and only then did the new string show up. Another way is to quit
netscape and launch it again.

I checked netscape on a PowerMac; the same problem shows up there also. 

Why does netscape keep running the old .class file? Why is that when I
make changes to the java code, recompile to get a newer .class file,
the new .class file is not picked up by netscape? Clearing the disk and
memory cache does not have any effect. Where does netscape keep the byte
code - in memory or on disk?

Here is my java code:
-----------------

import java.applet.*;
import java.awt.*;

public class FirstApplet extends Applet {
        public void paint (Graphics g) {
                g.drawString("Hello Java World", 25,50);
        }
}


And the html file
-----------------

<title>First Applet</title>
<h1>First Applet</h1>

<APPLET code="FirstApplet.class" width=150 height=100></APPLET>


I have tried other applets with the same results. 
-- 
Sohail Aslam                   
Assistant Professor, Lahore University of Management Sciences (LUMS)
Lahore, Pakistan    tel: 92-42-572-2670   fax: 92-42-572-2591
email: aslam@lums.edu.pk