Java compile

Da'iMacDaddy

Unix Newb.
I'm not sure if any one else has asked this but if I have Apple's Developer tools installed how do I compile a java program in the command line?

Any help would be appreciated.
 
Hrm, its been a while since I did java but as I remember it is something like

javac myclass.java

then

java myclass

to run it.

It is highly possible that I'm way wrong. :)
 
that is correct. you don't have to have the devtools installed to compile java, since the jdk (java developer kit) is installed in the base system. I suggest typing "javac" on the command line to get more information about how to compile (basically is just "javac ClassName.java" but there's a lot more to it).

Other good java commands are "jar" (installed with java) for packaging java-classes and other stuff in neat archives, and ant (get it at http://jakarta.apache.org/ant) which is a utility for automating java builds (much like make, but better).


theo
 
Back
Top