Using BioJava

BioJava will compile and run on any computer with a Java virtual machine complying to the Java 2 Standard Edition 1.2 (or later) specifications. NOTE: we have seen some problems due to a bug in the Classic VM in Java 1.2. Hotspot for Java 1.2 works fine, as does the Classic VM from later releases.

BioJava binaries are distributed in .jar (Java ARchive) format. You can always get the latest version in the binaries directory of the download area. You will also need:

  • The Xerces-J XML parser (xerces.jar)
  • A Java bytecode generation library (bytecode.jar)
  • (For current CVS versions and 1.3 releases) The Apache regular expressions library, (jakarta-regexp.jar)
None of these .jar files need to be unpacked for normal use -- simply place them in a convenient directory.

To use BioJava, add the BioJava and XML jar files to your CLASSPATH environment variable.

UNIX (bourne shell)
export CLASSPATH=/home/thomas/biojava.jar:/home/thomas/xerces.jar:/home/thomas/bytecode.jar:.
UNIX (C shell)
setenv CLASSPATH /home/thomas/biojava.jar:/home/thomas/xerces.jar:/home/thomas/bytecode.jar:.
Windows from command line
set CLASSPATH C:\biojava.jar;C:\xerces.jar;C:\bytecode.jar;.
Windows from autoexec.bat
set CLASSPATH=C:\biojava.jar;C:\xerces.jar;C:\bytecode.jar;.
You can now compile and run BioJava programs using the javac and java commands. You might like to look at the tutorial and API documentation, and try the demo programs included in the source distribution (see below).
Building your own

If you want to modify BioJava, you can obtain a copy of the source code from the Source directory of the download area. Source releases are distributed in .tar.gz format for Unix machines, and as ZIP archives for Windows users. You can also obtain up-to-the-minute source code from the anonymous CVS server

BioJava is built using the ANT build tool, a Java equivalent of the common Make utilities. Please download and install the latest version of ANT. It is available here.

To build the library, just change into the biojava-live directory and type ant. The final JAR file will be placed in the ant-build directory. You can also use the command ant javadocs to build the documentation bundle.

Building the demo programs

The source distribution contains a number of small demo programs. Once you have a working biojava.jar on your classpath, these can be compiled directly using javac from the demos directory.

  cd demos
  javac seq/
  java seq.TestEmbl seq/AL121903.embl
  cd demos
  javac seq\
  java seq.TestEmbl seq\AL121903.embl

cheap cigarettes