This is a mini-tutorial on how to compile and execute a java program. First read and understand the similar page for the C++ program. For the graduate class CIS656 I have a set-up similar to that for CIS456. I used the java program by one of the students in CIS656. He called his program ReadIpHeader.java , and sent it to me. I put it in a directory. Below you see the full path name of that directory. The command ``javac .java'' causes the program to be compiled. The resulting file, .class is not executable. (no x among the permission descriptions). maan-610 projA>: pwd /afs/cad.njit.edu/u/o/t/ott/classes/spring06/CIS656/Homework/Tsai/projA maan-611 projA>: ls -lt total 26 -rw-r--r-- 1 ott 30 13062 Mar 21 15:39 ReadIpHeader.java maan-612 projA>: javac ReadIpHeader.java maan-613 projA>: ls -lt total 40 -rw-r--r-- 1 ott 30 6358 Mar 26 13:25 ReadIpHeader.class -rw-r--r-- 1 ott 30 13062 Mar 21 15:39 ReadIpHeader.java maan-614 projA>: java ReadIpHeader < ../../test_little_in.txt > tsai_out maan-615 projA>: ls -lt total 46 -rw-r--r-- 1 ott 30 3046 Mar 26 13:26 tsai_out -rw-r--r-- 1 ott 30 6358 Mar 26 13:25 ReadIpHeader.class -rw-r--r-- 1 ott 30 13062 Mar 21 15:39 ReadIpHeader.java maan-616 projA>: But the file .class can be run, using the interpreter ``java''. There, input redirection and output redirection is used exactly as in C++. That is the line ``java ReadIpHeader < ../../test_little_in.txt > tsai_out'' . ls -lt shows that indeed a file tsai_out has been created. I must check (one way or another: use more, or use cat, or print the file, or use diff) that that output file has the correct content. I had a very quick look: It seems that tsai_out is correct. Do: ``man more'' , ``man cat'' , ``man lpr'' (which in NJIT has a different name), ``man lp'' , ``man diff''.