From owner-freebsd-java Tue Mar 10 07:42:16 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id HAA12454 for freebsd-java-outgoing; Tue, 10 Mar 1998 07:42:16 -0800 (PST) (envelope-from owner-freebsd-java@FreeBSD.ORG) Received: from pluto.plutotech.com (mail.plutotech.com [206.168.67.137]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id HAA12421 for ; Tue, 10 Mar 1998 07:42:12 -0800 (PST) (envelope-from kelly@plutotech.com) Received: from plutotech.com (tampopo.plutotech.com [206.168.67.161]) by pluto.plutotech.com (8.8.7/8.8.5) with ESMTP id IAA11733; Tue, 10 Mar 1998 08:42:00 -0700 (MST) Message-ID: <35055F48.DD56F6E5@plutotech.com> Date: Tue, 10 Mar 1998 08:42:00 -0700 From: Sean Kelly Organization: Pluto Technologies X-Mailer: Mozilla 4.04 [en] (X11; I; FreeBSD 3.0-CURRENT i386) MIME-Version: 1.0 To: Joe Shevland CC: freebsd-java@FreeBSD.ORG Subject: Re: Classpath & URLs References: <199803100233.NAA27684@oznet15.ozemail.com.au> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-java@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org > Can a Java application's classes be based, say, on a server, and accessed from > a client machine using the java command line script/executable, passing the > server URL/path in the classpath? The answer is a conditional "yes". The problem: a Java application can't do it out of the box. What you need to do is provide your own ClassLoader. Applets run in the appletviewer or in a web browser have such a customized ClassLoader that knows to turn a request for a certain class, say "fred.joe.Whatever", into a network request to the web server. The default ClassLoader for applications turns "fred.joe.Whatever" into "fred/joe/Whatever.class" and attempts to find that file by appending that string to each element of the current classpath. How much work is involved? Actually, not much. Most of java.net already has the things you need, and writing the ClassLoader itself is pretty simple. Take a look at java.lang.ClassLoader, especially the method loadClass. Good luck. --Sean To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-java" in the body of the message