Hi there,
I am trying to build my jar using the Ant facility.
I wrote build.xml and build.properties files and executed build.cmd
file.
I got the following error:
"complie:
[echo] Compiling java files
[echo]
[javac] Compiling 38 source files to C:\Dev_Env\...\build\output
BUILD FAILED
C:\Dev_Env\...\build\build.xml:98: The following error occurred while
executing this line:
C:\Dev_Env\...\build\build.xml:54: Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK"
My current JAVA_HOME is set to C:\j2sdk which do exists.
My current ANT_HOME is set to c:\ant
This is the compilation segment in build.xml:
----------------------------------
<target name="complie" depends="init">
<echo message="Compiling java files">
</echo>
(line 54) <javac srcdir="${java_src}" destdir="${dest}" source="1.4">
<classpath>
<fileset dir="${dest}/lib">
<include name="**/*.jar"/>
</fileset>
</classpath>
</javac>
</target>
------------------------------------
It seems to me that for some reason it takes a wrong jdk path but I
can't understand why and from where.
Any help will be appreciated.
Thanks!
jaja - 16 Sep 2007 14:46 GMT
> Hi there,
> I am trying to build my jar using the Ant facility.
[quoted text clipped - 38 lines]
> Any help will be appreciated.
> Thanks!
By the way, I just saw that even in the ant.bat file it is set
JAVA_HOME=C:\j2sdk which seems to be ok to my knowledge...
jaja - 16 Sep 2007 15:03 GMT
> > Hi there,
> > I am trying to build my jar using the Ant facility.
[quoted text clipped - 43 lines]
>
> - -
Ok, I found at least a workaround:
I copied the file tools.jar from c:\j2sdk\lib to the ant lib directory
and build was successful.
Roedy Green - 17 Sep 2007 03:59 GMT
>My current JAVA_HOME is set to C:\j2sdk which do exists.
That sounds like a pretty old Java. Try using the current version.
JAVA_HOME=E:\program files\java\jdk1.6.0_02

Signature
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com