Getting JAVA to work with Netscape Navigator from a local disk.

Anthony Hundt ([email protected])
Tue, 12 Dec 1995 16:36:42 +0000


> After a fairly substantial expenditure of effort,
> I discovered why I had had trouble executing the "Hello
> World" applet with Netscape Navigator 2.0b3 (for 32-bit Windows.)
>
> It turns out that Navigator's implementation of Java will not execute
> an applet from an HTML page that is accessed with a type specifier
> other than ghttp:".
>
> Since HTML files on one's local disk are typically accessed with
> the "file:" type specifier, applets will not execute.
>
> The solution was to find and install an http server on my computer,
> and to read the files on the local disk via a network connection to the
> server.
>
> Considering the inelegance of the solution and the obscurity of the problem,
> I believe this story warrants repsating to anyone who is about to learn Java.

I have been lurking on the VRML list for a while and I think I've
found the solution JAVA problem. I am using Windows95 and
Netscape Navigator 2.0b3. I got it to work after setting the CLASSPATH
environment variable in my AUTOEXEC.BAT. Here's what I have mine
set to:

set CLASSPATH=c:\progra~1\netscape\nabigator\program\java\classes;
c:\progra~1\java\classes;.

When you set this, don't forget the final dot (meaning the current
directory). And here's my HTML file:

<HTML>
<TITLE> Hello World </TITLE>
<BODY>
Here is an applet:
<APPLET CODEBASE="/C:/Program Files/Java/JavaHtml/classes" CODE="HelloWorld.class" WIDTH=150 HEIGHT=25>
</APPLET>
</BODY>
</HTML>

Also, the demos from the JDK (Java Development Kit) seem to work fine.

As for "a fairly substantial expendature of effort" it only took me about
half an hour to figure this out.

Anthony Hundt
B&B Electronics (http://www.bb-elec.com)
email: [email protected]
voice: (815)433-5100 ext 226
fax: (815)434-7094


  • Next message: George Kyriazis: "Re: ANNOUNCE: VRML Press Launch"
  • Previous message: James Waldrop: "Re: An URL to ponder"
  • Next in thesad: ^e: "Re: Getting JAVA to work period."