![]()
Install Rome
You can download Rome 0.7, an RSS Java library to produce RSS output, similar to the Perl XML::RSS library, from the class website:
Save the tar file in your home directory and use "gtar" to extract the files.
Setting up the Java VM and SDK
For both Java applications and Java Servlet development, you need to set up a number of environment variables. In your root directory (/home/scf-xx/YOUR-USERNAME/), set the following new environment variables, by appending the following lines to the file .cshrc:
setenv JDK_HOME /usr/j2se
setenv JAVA_HOME /usr/j2se
setenv PATH /usr/j2se/bin/:${PATH}
Then you need to set up the Java CLASSPATH, i.e. where Java looks for JAR files (assuming that you unpacked Rome in your root directory):setenv ROME_HOME ~/rome-0.7
setenv CLASSPATH .:${ROME_HOME}/rome-0.7.jar:${CLASSPATH}
Important: Note the "dot" (the current directory) listed at the beginning of the CLASSPATH. The "javac" compiler always looks for files in the current directory (whether "." is included in the classpath or not), but the "java" interpreter only looks into the current directory if the "." directory is in the classpath. If you have no classpath set this is not a problem -- the default classpath consists of the "." directory -- but if you have set the classpath and forgot to include the ".", then your programs will compile without error, but they won't run. [see Core Java - Volume I Fundamentals, p. 137]You can find more information on how to set the CLASSPATH at http://java.sun.com/j2se/1.4.2/docs/tooldocs/solaris/classpath.html .
You can now invoke the Java compiler to compile your application, as follows:
javac -classpath $CLASSPATH my_java_program.java
You can find more information on "javac", the Java programming language compiler, at http://java.sun.com/j2se/1.4.2/docs/tooldocs/solaris/javac.html .
Then you can use the Java runtime to run your application, as follows:
java -classpath $CLASSPATH my_java_program
You can find more information on "java", the Java application launcher, at http://java.sun.com/j2se/1.4.2/docs/tooldocs/solaris/java.html .
Using Rome with Servlets
For Servlet development using Tomcat, you should also copy two of the JAR files to the Tomcat directory $CATALINA_HOME/shared/lib, as follows:
cp $ROME_HOME/rome-0.7.jar $CATALINA_HOME/shared/lib
Full documentation on the Rome API is available on your downloaded distribution at:
$ROME_HOME/docs/index.html
Important Note: depending on the API that you use (SyndFeedOutput, for example), you may have to also load the JDOM 1.0 JAR file.
You can download JDOM 1.0, another Java API for XML processing, from the class website:
and unpack it in the same directory where you downloaded Rome.If you are using Windows XP to download your file, the file may be saved as jdom.zip. If that happens to you, rename it jdom.jar. Before you start compiling your .java files you should update the CLASSPATH, as follows:
setenv CLASSPATH ${ROME_HOME}/jdom.jar:${CLASSPATH}
You should then copy the JAR file to the Tomcat directory $CATALINA_HOME/shared/lib, as follows:
cp jdom.jar $CATALINA_HOME/shared/lib
![]()