WebReference.com - Part 2 of Extending the JXTA Shell, from Early Adopter JXTA (Wrox Press). (4/4)
[previous] |
Early Adopter JXTA
Compiling, Archiving and Deploying the mkdoc Command
mkdoc CommandIn the src directory of the code distribution, you will find a Win32 batch
file called makedoc.bat that can be used to compile the command and create the
deployable JAR file. This batch file contains the following script:
set SHELLROOT=..
javac -classpath %SHELLROOT%\lib\jxta.jar;%SHELLROOT%\lib\jxtashell.jar -d %SHELLROOT%\classes net\jxta\impl\shell\bin\mkdoc\*.java
cd ..\classes
jar cvf ..\custcmds\doccmd.jar net\jxta\impl\shell\bin\mkdoc\*.class
cd ..\src
The resulting JAR file is called doccmd.jar and placed in the custcmds
directory waiting for deployment.
Change directory to custcmds, and start the shell using the runshell.bat
file.
Now, you can install the shell extension:
JXTA> instjar doccmd.jar
Finally, you can test out the mkdoc command. You might want to use the
custdoc usage scenario presented earlier as your initial attempt.
We have seen yet again that extending the JXTA shell with custom commands is actually
quite easy once we get the hang of it. In fact, you can create your own collection of frequently used
custom commands relatively easily. The instjar and uninstjar
mechanism makes using these extensions a joy.
[previous] |
Created: January 28, 2002
Revised: January 28, 2002
URL: http://webreference.com/programming/jxta/chap3/2/4.html

Find a programming school near you