bash$ which javacto see if the javac program is in your path. It should return /opt/local/bin/javac. You are now ready to compile and run java programs:
bash$ javac filename.java |
(compiles the program) | |
bash$ java filename | (runs the program) |
PATH=$PATH:/opt/local/binAlso, add the proper entry for the CLASSPATH environment variable in your .profile file:
CLASSPATH=/opt/local/bin:.; export CLASSPATH