## Upgrade to CorpusSearch 2

CorpusSearch 2 is an open source program written in Java. It is available for free download from Sourceforge. CorpusSearch 2 is under development and new versions come out frequently. Download the latest version available from the list of releases.

1. Download the current version of the CS_2.jar file from sourceforge (http://corpussearch.sourceforge.net).
2. Put the file in a convenient place, for example the Applications folder under Mac OS X or the Program Files folder under Windows.
3. Open a window that allows you to run commands - the Terminal program under Mac OS X, an xterm window under Unix or Linux. Windows users see below.
4. Assuming that you have put CS.jar into the folder FOO, the following line will start CorpusSearch in any flavor of Unix that has Java installed (including Mac OS X):

       prompt> java -classpath /FOO/CS.jar csearch/CorpusSearch

   Note that we are assuming Unix path syntax and that FOO is a top-level directory. The classpath must give the full path, using appropriate syntax.

### Windows users

Put the CS.jar file (the file will actually have a name something like CS_2-002.18.jar) into the Program Files folder.

1. Open a file in Notepad (or other ascii editor, such as 'edit'). It is important that the file is plain text and has no hidden characters.

2. Type the following two lines into the file where, as above, CS_version.jar stands for whichever version of CS2 you have downloaded, e.g., CS_2-002.18.jar. If you've put the CS_version.jar file in some directory other than Program Files, replace this with the correct directory name.

       set CLASSPATH=C:\Program Files\CS_version.jar
       java csearch/CorpusSearch

   | Note the change in direction of the slashes in the second line. This is not a typo!

3. Save the file as cs2.bat (or any name you like as long as the extension is .bat) in the directory where you do your searches

4. Launch the command prompt via Start | Run and type `cmd.exe` in the box (`command` under Windows 98).

5. You should get the following prompt: "C:\"

6. Change to the directory where you do your searches

Now you can run CS2 by simply typing `cs2` at the prompt. This will launch a dialogue that will prompt you for a query file, source files, and output file. Alternatively, you can include the query and source file(s) on the command line:

    cs2 query.q source.psd

In this format the output file will automatically be given the same name as the query file with the extension .out (i.e., in the example `query.out`). To specify a different output file, use the following format:

    cs2 query.q source.psd -out differentoutfile.out

If you are using Windows, we recommend downloading a copy of the Java Virtual Machine (Java Runtime Environment) from Sun, version 1.4 or later (http://java.com/en/) rather than running Microsoft's Java. To check which virtual machine you are running under Windows, in the command window, type:

    java -version

If you have been using CorpusSearch 1.1, you should already have the Sun Java Runtime Environment.