< Zurück | Inhalt | Weiter >

8.3.1 Installing jCVS

jCVS can be downloaded from www.jcvs.org where you can get it as a zipped archive file. Unzip it into a directory and create a shell script to make it easy to invoke. Since jCVS is an actual Java program, all the shell script needs to do is to ensure that its JAR files are on the CLASSPATH and then invoke the jCVS main class.

Here’s a straightforward shell script which will accomplish that:

JCVS="/usr/local/jCVS-5.2.2" CLASSPATH="${CLASSPATH}:${JCVS}/jars/activation.jar" CLASSPATH="${CLASSPATH}:${JCVS}/jars/jcvsii.jar" CLASSPATH="${CLASSPATH}:${JCVS}/jars/jh.jar" CLASSPATH="${CLASSPATH}:${JCVS}/jars/js.jar"

java -jar ${JCVS}/jars/jcvsii.jar

You would need to change the definition of JCVS to match the directory where you unpacked the ZIP file, but the rest will work with your location. Of course the classpath could all be set on one longer line, but this way is more readable.

Run jCVS (Figure 8.5) and navigate to the checkout page (Figure 8.6) to fill in the parameters for your CVS server. Then you should be able to contact it for checking out your sources (Figure 8.7).


Figure 8.5 jCVS splash screen


Figure 8.6 jCVS initial screen

8.4 Review 213



Figure 8.7 jCVS checkout screen

Conspicuous in its absence on the jCVS Web site is a good user manual.

Since we’re proponents of the command line, don’t look for it here, either.

Many, if not most, Java developers these days will be using, at least part of the time, an Integrated Development Environment (IDE). One of the tools that these IDEs integrate is a source code manager, and typically for Open Source tools that means CVS. So while we’re not giving you much info on jCVS, you will find a useful GUI for CVS inside most IDEs.


This chapter has been all about CVS, one of the great jems of the Open Source world. Projects all across the globe depend on CVS to track their source changes, as programmers half a world away collaborate and share source.

We discussed how to import source files into CVS and how to get them back out. We discussed the mechanism for checking in changes and how to sort out collisions for the rare occasions when automatic merges don’t succeed. We described how to tag a set of source files for later retrieval, and how to make

those tags into branches in your source tree. We also discussed how to show the history of those changes and the status of a source file. Finally, we took a quick look at a GUI for use with CVS, for those so inclined.


• The myriad of administrative commands which help you manage and maintain a source library. Most of those commands you won’t need, but it’s nice to know that they are available, just in case. Refer to the Cederqvist document (Section 8.6) for all the gory details.

• How to set up remote users for sharing a CVS repository on a network, especially the use of the CVS_RSH environment variable.

• How CVS integrates into development tools. We’ll see this in the coming chapters; for example, CVS interaction is built into NetBeans, SunONE Studio, and Eclipse.

• How good it feels to have CVS come to the rescue so you can recover a version of something that you thought was lost. May you never have to learn this the hard way.


Version Management with CVS by Per Cederqvist et al. is the “official” manual for CVS. It can be viewed as HTML or downloaded as HTML, PDF, or PostScript from http://www.cvshome.org/docs/manual/.

• Chapter 6 of The LINUX Development Platform: Configuring, Using and Maintaining a Complete Programming Environment by Rafeeq Rehman and Christopher Paul (ISBN 0130826758, Prentice Hall PTR) gives a good introduction to CVS. They give more information, too, on jCVS as well as on how to integrate CVS into Emacs.