Hi Alex. Welcome to JavaRanch. Your question isn't very specific as to which OS you're using or what you've tried so far, so I can't give a very specific answer.
Here are the directions from the initial CattleDrive page:
Download the
JDK 5.0 (also known as the jdk-1.5.0) from Sun. You don't need the
IDE or other stuff, just the plain ole jdk.
It is possible that once you have installed the JDK, everything will work fine as is. If you are not one of the lucky ones, you may need to adjust your PATH and CLASSPATH environment variables. On my windows machine, my PATH includes
C:\Program Files\Java\jdk1.5.0_14\bin
and my CLASSPATH is set to
.;C:\java (notice the dot before the first semicolon)
I put all of my stuff into a directory called java (off of my root, C:\, in Windows and off of my home directory in unix).
Here is a program that you can cut and paste to make sure that you have everything set up correctly. Make sure you put it into a file called HelloWorld.java (case is important! even on Windows computers):
<code>public class HelloWorld
{
public static void main(
String[] args )
{
System.out.println("hello world!");
}
}</code>
Make sure that you paste this into a text editor (like notepad) and not a
word processor. A word processor will stick a bunch of extra formatting text into the file.
Pull up a console (DOS) or terminal window and put the HelloWorld.java file into your java directory. Make the java directory your current directory. Type
javac HelloWorld.java
and press enter. Remember: case is still very important, even on Windows computers. If the program compiles without flaw, you will get your command prompt back. Otherwise, go to the Cattle Drive (java college) forum and tell us what went wrong.
To run your program, type
java HelloWorld
and press enter.
You should then see "hello world!" on your screen.
[ January 07, 2008: Message edited by: Marilyn de Queiroz ]