cd <your-classes-directory> javac HelloWorld.java cd COM\foo\protocol\run javac Handler.java javac RunURLConnection.java
If compilation succeeds, the compiler creates files named Handler.class and RunURLConnection.class for the protocol handler, and HelloWorld.class for the applet. If compilation fails, make sure you typed in and named the programs exactly as shown.
In the HotJava Browser properties file, set the java.protocol.handler.pkgs property to include your new protocol package, COM.foo.protocol. This property is a vertical bar (|) separated list of package prefixes that defines a search path for protocol handlers.See Customizing the HotJava Browser for information about where to find the properties file for your platform.
For this example, you would add the following line to your HotJava Browser properties file:
java.protocol.handler.pkgs=COM.foo.protocolIf you have other protocol handlers defined, use a vertical bar (|) separated list as the value of the property. For example:
java.protocol.handler.pkgs=COM.foo.protocol|other.protocol
Set the CLASSPATH environment variable to include your classes directory, so that HotJava can find the run protocol handler and the test applet.On UNIX systems, the method of setting environment variables depends on your shell. For C shell, you can enter something like the following at the shell prompt, or put it in your .cshrc file:
setenv CLASSPATH .:/home/developer/classesOn Windows sytems, enter something like the following in a DOS shell, the Windows NT Control Panel, or your AUTOEXEC.BAT file:
set CLASSPATH=.;C:\developer\classes
Even if the HotJava Browser is already running, you need to restart it so that it can read the new values of the java.protocol.handler.pkgs property and CLASSPATH environment variable.
Load the "run:" protocol handler and the applet, using a URL such as this:run:HelloWorldYou should see the applet running in the page that appears. Now you can use your new protocol handler wherever you can specify a URL (e.g. links in HTML pages, in the URL typein field, etc.).
Back to HotJava User's Guide Table of Contents