Setting up the Java Environment for CS 371R:
Intelligent Information Retrieval and Web Search



[A] Setting up Java aliases:

On the UTCS Linux and Sparc platforms, "java" and "javac" may point to /usr/bin/java, which is the old version. We will be using the new version of java in /lusr/java5/bin. Check by typing which java and which javac. If necessary, first create aliases to java and javac by typing at the command prompt:

On tcsh or csh shells in Unix: alias javac /lusr/java5/bin/javac; alias java /lusr/java5/bin/java
On bash shell in Unix: alias javac=/lusr/java5/bin/javac; alias java=/lusr/java5/bin/java

Instead of typing these in everytime you run the code, you can also add these lines in the .cshrc file (for tcsh or csh), or the .bashrc and .profile files (for bash).

[B] Running the code from Prof. Mooney's installation:

1. Setting up the classpath for java

On tcsh or csh shells in Unix: setenv CLASSPATH '.:/u/mooney/ir-code'
On bash shell in Unix: export CLASSPATH='.:/u/mooney/ir-code'

Instead of typing these in everytime you run the code, you can also add these lines in the .cshrc file (for tcsh or csh), or the .bashrc and .profile files (for bash).

2. Running the code

At the command prompt, type:
java ir.vsr.InvertedIndex -html /u/mooney/ir-code/corpora/yahoo-science/

Follow the trace at www.cs.utexas.edu/users/mooney/ir-course/sample-trace.txt for a list of possible commands to try out.

[C] Making your own copy of the code and running your installation:

1. Copy the ir sub-directory from the ir-code directory into your HOME directory

At the command prompt, type: cp -r /u/mooney/ir-code/ir $HOME

2. Setting up the classpath for java

On tcsh or csh shells in Unix: setenv CLASSPATH '.:/u/[your-login-name]'
On bash shell in Unix: export CLASSPATH='.:/u/[your-login-name]'

where [your-login-name] is your Unix login name.

Instead of typing these in everytime you run the code, you can also add these lines in the .cshrc file (for tcsh or csh), or the .bashrc and .profile files (for bash).

3. Running the code

At the command prompt, type: java ir.vsr.InvertedIndex -html /u/mooney/ir-code/corpora/yahoo-science/

Follow the trace at www.cs.utexas.edu/users/mooney/ir-course/sample-trace.txt for a list of possible commands to try out.

4. Recompiling after modifying code in the ir directory

If you modify the file ABC.java, you can recompile it using the command: javac ABC.java