ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rhino" <rhi...@sympatico.ca>
Subject Compiling enums in Ant 1.6.5
Date Thu, 15 Dec 2005 22:36:52 GMT
Can the <javac> task in Ant 1.6.5 compile a typesafe enum when using the 
'modern' compiler? If yes, how do I persuade it to do so? If no, is there 
any workaround or will I just have to compile the enum separately and 
include it in my build manually?

Here is my task:

<target name="compile" description="Compile the Java code.">
 <javac srcdir="${common.src}" destdir="${common.bin}" compiler="modern" 
fork="yes"
  verbose="no" debug="on" debuglevel="lines,vars,source" deprecation="yes"
  description="Compile the code in the common package.">
  <patternset refid="ps.common"/>
  </javac>
</target>

Here is the (relevant) output from the build, which had both the -debug 
and -verbose switches on:

[javac] 
E:\eclipse\3.0.1\eclipse\workspace\Common\src\ca\maximal\common\Palette.java:19: 
'class' or 'interface' expected

[javac] public enum Palette {

[javac] ^


For what it's worth, I tried adding the source="1.5" parameter to the target 
and got the message "javac: invalid source release: 1.5". My JAVA_HOME 
environment variable is set to D:\Program Files\Java\jre1.5.0_06, otherwise 
I'd suspect that I was pointing at a 1.4 (or earlier) compiler.

Can anyone shed some light on how I can get Ant to compile this enum?

Rhino



-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.13.13/200 - Release Date: 14/12/2005


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message