Hi,
A basic question. I am running eclipse and tried running a ant script
and got the error "Unable to find a javac compiler". Is this because I
need to install a JDK ? If so how can confirm if I have this installed
or not.
You need to install a JDK. At a minimum, declare an environment variable
("envar") JAVA_HOME set to the installation directory. Most people add the
"bin/" subdirectory of JAVA_HOME to their PATH as well.
You know if you installed it by whether you or the sysadmin for the
workstation installed it, and by whether an executable "javac" (for Windows,
"javac.exe") exists on the system (in that aforementioned "bin/"
subdirectory). The parent directory of javac's "bin/" is the installation
directory.
For example, on my system the JDK is installed in "/opt/java/java/" and the
javac command is in "/opt/java/java/bin/".
$ echo $JAVA_HOME
/opt/java/java
$ ls $JAVA_HOME/bin/
appletviewer jarsigner jconsole jrunscript native2ascii schemagen xjc
apt java jcontrol jsadebugd orbd serialver
ControlPanel javac jdb jstack pack200 servertool
extcheck javadoc jhat jstat policytool tnameserv
HtmlConverter javah jinfo jstatd rmic unpack200
idlj javap jmap jvisualvm rmid wsgen
jar javaws jps keytool rmiregistry wsimport