Re: Compile error

Steve Loughran <[email protected]>
Newsgroups gmane.comp.java.smartfrog.devel
Message-ID <[email protected]>
Guijarro, Julio wrote:
> Hal is correct. 
> 
> Use javac -source 1.4 or if you are using ant to compile, make sure that
> your javac task has something like this: compiler="javac1.4"
> source="1.4"
> Ex.
> <javac srcdir="${src}" destdir="${build}" debug="${debugmode}"
> compiler="javac1.4" source="1.4">
> 
> Julio G


or source="1.5"; if you want to use Java1.5 features. No need to set the 
compiler attribute though, Ant works that bit out for you.

for builds under ant, I recommend making it a property, as you will need 
the same property in your javadoc task.

<property name="javac.java.version" value="1.4"

<javac srcdir="${src}" destdir="${build}" debug="${debugmode}" 
includeAntRuntime="false"
	source="${javac.java.version}"> ...

Looking at what we do in common.xml, we have this template which sets 
both sourde and target to the version you pass in

     <presetdef name="sf-javac">
        <javac debug="${javac.debug.mode}"
             nowarn="true"
             deprecation="${javac.deprecation.mode}"
             source="${javac.java.version}"
             target="${javac.java.version}"
             includeAntRuntime="false"
             includes="**/*.java"
             >
        </javac>
     </presetdef>

-steve


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.