Could you paste your build.xml?
Main Topics
Browse All TopicsI am new to Java and was recommended Bruce Eckel's book "Thinking in Java, 4th edition." The book and sample source is supposed to work for Java SE5 and SE6. I installed SE6 on my machine and downloaded the source. When I attempted to build the source, it got errors from the build.xml file(s) saying J2SE5 was required.
Has anyone experienced this?
Thanks
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
The build.xml follows. Note, although I'm not familiar with ant, I do see the refs to j2s3 5. I guess my question is, is the books source code really compatible for java 6 or is there a problem in the build.xml.
<?xml version="1.0" ?>
<project basedir="." default="run" name="Thinking in Java, 4th Edition by Bruce Eckel">
<description>
Main build.xml for the source code for
Thinking in Java, 4th Edition by Bruce Eckel
Code available at http://www.MindView.net
See copyright notice in CopyRight.txt
Ant available from: http://jakarta.apache.org/
To see options, type: ant -p
</description>
<condition property="version1.5">
<equals arg1="1.5" arg2="${ant.java.version}"
</condition>
<filelist id="buildfiles" dir="."
files="object/build.xml
operators/build.xml
control/build.xml
initialization/build.xml
access/build.xml
net/build.xml
reusing/build.xml
polymorphism/build.xml
interfaces/build.xml
innerclasses/build.xml
holding/build.xml
exceptions/build.xml
strings/build.xml
typeinfo/build.xml
generics/build.xml
arrays/build.xml
containers/build.xml
io/build.xml
xml/build.xml
enumerated/build.xml
annotations/build.xml
concurrency/build.xml
gui/build.xml
frogbean/build.xml
bangbean/build.xml
swt/build.xml
"/>
<target name="run" description="Compiles and runs all examples">
<delete file="errors.txt"/>
<subant>
<filelist refid="buildfiles"/>
</subant>
<available file="errors.txt" property="errors"/>
<antcall target="finish"/>
</target>
<target name="build" description="Compiles all examples">
<fail message="J2SE5 required" unless="version1.5"/>
<delete file="errors.txt"/>
<subant target="build">
<filelist refid="buildfiles"/>
</subant>
<available file="errors.txt" property="errors"/>
<antcall target="finish"/>
</target>
<target name="clean" description="delete all byproducts">
<delete>
<fileset dir="${basedir}" includes="**/*.class"/>
<fileset dir="${basedir}" includes="**/*Output.txt"/
<fileset dir="${basedir}" includes="**/log.txt"/>
<fileset dir="${basedir}" includes="errors.txt"/>
<fileset dir="${basedir}" includes="failures"/>
</delete>
<echo message="clean successful"/>
</target>
<target name="finish" if="errors">
<echo message="Errors occurred. See errors.txt for information."/>
</target>
<target name="verify" depends="run"
description="Verifies comment output; requires Python 2.3">
<exec executable="python">
<arg value="OutputVerifier.py"/
</exec>
</target>
<target name="findbugs" depends="build"
description="Runs findbugs. Must install findbugs from findbugs.sourceforge.net">
<exec executable="findbugs.bat">
<arg value="-textui"/>
<arg value="-sortByClass"/>
<arg value="-exclude"/>
<arg value="FindBugsFilter.xml"
<arg value="-html"/>
<arg value="."/>
<redirector output="findbugs.html"/>
</exec>
</target>
<target name="findbugs-plain" depends="build"
description="Runs findbugs with plain text output">
<exec executable="findbugs.bat">
<arg value="-textui"/>
<arg value="-sortByClass"/>
<arg value="-exclude"/>
<arg value="FindBugsFilter.xml"
<arg value="."/>
<redirector output="findbugs.txt"/>
</exec>
</target>
<target name="findbugs-xml" depends="build"
description="Runs findbugs with xml output">
<exec executable="findbugs.bat">
<arg value="-textui"/>
<arg value="-sortByClass"/>
<arg value="-exclude"/>
<arg value="FindBugsFilter.xml"
<arg value="-xml"/>
<arg value="."/>
<redirector output="findbugs.xml"/>
</exec>
</target>
</project>
Actually, objects suggestion causes more errors. The line in the build following the fail message displays an error if I comment out the fail message. Since my goal is to learn Java, I think I'll just install java 1.5. It's odd that the author's web site contains no information under errata discussing this problem.
All,
I actually heard from the author and he pointed me to an alternative download site for the source. Unfortunately, his build.xml still has the same problem. So, even the author is unaware of the problem, it seems. In any case, I've discovered a way to modify the build.xml file to specify to use a version number or anything less than that version. That way you're not tied to a specifiec version.
The following is a build file for a similar project that handles the versions correctly. Note the condition property. I didn't apply this change to my originally posted build file since I decided just to use java 1.5 which suits my purposes at the moment.
<?xml version="1.0" ?>
<project basedir="." default="run" name="Thinking in Java, 4th Edition Solution Guide">
<description>
Main build.xml for the source code for
Thinking in Java, 4th Edition Solution Guide
Code available at http://www.MindView.net
See copyright notice in CopyRight.txt
Ant available from: http://jakarta.apache.org/
To see options, type: ant -p
</description>
<condition property="minimumAntVersio
<antversion atleast="1.7.0"/>
</condition>
<fail message="Ant Version of at least 1.7 required" unless="minimumAntVersion"
<condition property="version1.5OrGrea
<not>
<or>
<equals arg1="${ant.java.version}"
<equals arg1="${ant.java.version}"
<equals arg1="${ant.java.version}"
<equals arg1="${ant.java.version}"
</or>
</not>
</condition>
<fail message="J2SE5 or greater required" unless="version1.5OrGreate
<filelist id="buildfiles" dir="."
files="net/build.xml
swt/build.xml
typeinfo/build.xml
object/build.xml
operators/build.xml
control/build.xml
initialization/build.xml
access/build.xml
reusing/build.xml
polymorphism/build.xml
interfaces/build.xml
innerclasses/build.xml
holding/build.xml
exceptions/build.xml
strings/build.xml
generics/build.xml
arrays/build.xml
containers/build.xml
io/build.xml
enumerated/build.xml
annotations/build.xml
concurrency/build.xml
gui/build.xml
"/>
<target name="run" description="Compiles and runs all examples" depends="build">
<delete file="errors.txt"/>
<subant>
<filelist refid="buildfiles"/>
</subant>
<available file="errors.txt" property="errors"/>
<antcall target="finish"/>
</target>
<target name="build" description="Compiles all examples">
<delete file="errors.txt"/>
<subant target="build">
<filelist refid="buildfiles"/>
</subant>
<available file="errors.txt" property="errors"/>
<antcall target="finish"/>
</target>
<target name="clean" description="delete all byproducts">
<delete>
<fileset dir="${basedir}" includes="**/*.class"/>
<fileset dir="${basedir}" includes="**/*Output.txt"/
<fileset dir="${basedir}" includes="**/log.txt"/>
<fileset dir="${basedir}" includes="errors.txt"/>
<fileset dir="${basedir}" includes="failures"/>
</delete>
<echo message="clean successful"/>
</target>
<target name="finish" if="errors">
<echo message="Errors occurred. See errors.txt for information."/>
</target>
<target name="verify" depends="build"
description="Verifies comment output; requires Python 2.3 or newer">
<exec executable="python">
<arg value="OutputVerifier.py"/
</exec>
</target>
<target name="findbugs" depends="build"
description="Runs findbugs. Must install findbugs from findbugs.sourceforge.net">
<exec executable="findbugs.bat">
<arg value="-textui"/>
<arg value="-sortByClass"/>
<arg value="-exclude"/>
<arg value="FindBugsFilter.xml"
<arg value="-html"/>
<arg value="."/>
<redirector output="findbugs.html"/>
</exec>
</target>
<target name="findbugs-plain" depends="build"
description="Runs findbugs with plain text output">
<exec executable="findbugs.bat">
<arg value="-textui"/>
<arg value="-sortByClass"/>
<arg value="-exclude"/>
<arg value="FindBugsFilter.xml"
<arg value="."/>
<redirector output="findbugs.txt"/>
</exec>
</target>
<target name="findbugs-xml" depends="build"
description="Runs findbugs with xml output">
<exec executable="findbugs.bat">
<arg value="-textui"/>
<arg value="-sortByClass"/>
<arg value="-exclude"/>
<arg value="FindBugsFilter.xml"
<arg value="-xml"/>
<arg value="."/>
<redirector output="findbugs.xml"/>
</exec>
</target>
</project>
Business Accounts
Answer for Membership
by: humanonomicsPosted on 2008-12-15 at 08:37:29ID: 23175030
Can you display the contents of build.xml and the detailed error as you are getting, please?