Learning the JXTA Shellby Rael Dornfest
I want to talk about the implications for that marvelous aspect of the fundamental UNIX design: the pipe, and its ability to connect small independent programs so that they could collectively perform functions beyond the capability of any of them alone. What is the equivalent of the pipe in the age of the Web?
-- Tim O'Reilly, JavaOne Keynote: "The Network Really is the Computer."
The JXTA shell is a command-line interface to Sun's JXTA (pronounced "Juxta") peer-to-peer framework. Originally written as a debugging tool for developers, the JXTA Shell affords a ground-floor view of the JXTA environment, much like a traditional shell drops one into the thick of a *nix operating system.
The JXTA shell is a fine demonstration of some of the key features of
the JXTA platform. The shell itself is nothing more than a framework
for dynamically loading and binding commands (read: classes) to the
JXTA underpinnings. This allows you, the user, to extend the shell to
your heart's content. Who'll be the first to write
As we'll see in this article, inter-peer messages in JXTA are nothing more than XML documents, a fact that provides various interesting intersections with Web Services (via XML-RPC and SOAP), syndication (via RSS), Instant Messaging a la Jabber, and more.
This article is an introductory tour of the JXTA shell. We'll step through some of its simple commands and move to more interesting examples constructed from these core building blocks. (For an overview of the JXTA platform, see the accompanying article, The JXTA Position.)
Anyone familiar with command-line shells, whether DOS or *nix, will
feel right at home in the JXTA shell. There are basic commands:
man, cat, env, grep, more, and more. Commands can, of course, be
sewed together using pipes to create compound commands:
env | wc.
Multiple commands on one line are separated by semicolons:
whoami ; man man. All in all, aside from the fact that it's easy to forget
that it's not a complete shell (see "Gotchas"),
there are few surprises.
First things first; we'll download, install and launch the JXTA shell.
The JXTA Shell is freely downloadable from the Jxta.org site at
Installers are available for various platforms, as well as ZIP
archives and CVS
Note: At the time of this writing, Windows 2000 users may have trouble with the Windows installer launching and disappearing without doing much of anything, save perhaps hanging around in the background. If this happens, you may want to download the latest nightly build.
Launch the JXTA shell by double-clicking on the jxta.exe icon
in the shell subdirectory of wherever you put the
JXTA Application Icon
The first time you run the shell, the JXTA Configurator dialog will
appear. Leave the defaults as they are; all you need do is
fill in a name for your peer (anything will do) in the Peer
Name field and click the OK button to move on.
The JXTA Configurator
The JXTA shell window should appear and you're ready to go.
The JXTA Shell
Note: I found a couple of bugs that can cause the shell not to launch. If, after closing the configurator, the shell does not appear momentarily, double-click the jxta.exe icon to relaunch. Windows 2000 users may find this makes no difference and will need to log out (not reboot, mind you) and log in again before continuing.
This article was written using version 0.9 (build 14e, 04-22-2001).
For versioning, type
version at the command-line.