You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by James Black <jb...@ieee.org> on 2004/01/22 17:58:27 UTC

re: using jdk1.5alpha for javac

Hello,
  I am trying to figure out how to get the javac task to work, but I am 
having a problem with one option.

  I am trying
<javac
    fork="yes"
    executable="/usr/j2sdk1.5.0/bin/javac"
    source="1.5"
    srcdir="...">


  Everything works until I try source="1.5", then I get an error.

  I want to start trying to use some of the new features (such as 
autoboxing) and see if it works fine on the production server running 
jdk1.4.2.

   I can't just set my path to point to the 1.5 jdk because I have a 
problem with junitreport, which appears to be a bug in xalan, so I just 
want to compile with 1.5, then run my tests with 1.4.2.

  Thank you for any suggestions.


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


Re: using jdk1.5alpha for javac

Posted by James Black <jb...@ieee.org>.
Markku Saarela wrote:

> In order to do that you must patch latest version of xalan.jar's file 
> Encodings.properties.
> Just  add  new line to end of file. Put this xalan.jar to 
> \j2sdk1.5.0\jre\lib\endorsed directory and it should work.
>
> It's not a xalan bug it is bug in java.util.Properties.class 

  Thank you for the response. I will try this today.



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


Re: using jdk1.5alpha for javac

Posted by Markku Saarela <ma...@entra.fi>.
   I can't just set my path to point to the 1.5 jdk because I have a 
problem with junitreport, which appears to be a bug in xalan, so I just 
want to compile with 1.5, then run my tests with 1.4.2.

You can set you path to point  jdk 1.5 and then just use  this 
source="1.5" :
   <javac destdir="${build.classes.dir}"
           debug="on"
           optimize="off"
           source="1.5"
           deprecation="on">
      <src path="${src.dir}"/>
      <classpath refid="compile.classpath" />
    </javac>

In order to do that you must patch latest version of xalan.jar's file 
Encodings.properties.
Just  add  new line to end of file. Put this xalan.jar to 
\j2sdk1.5.0\jre\lib\endorsed directory and it should work.

It's not a xalan bug it is bug in java.util.Properties.class

I filed bug report on that  and it should be visible in JDC in few 
working days.

Bug-ID: 4982523

synopsis : REGRESSION: Properties method load() drops end of file in a comment
description : /*
 * If the last line of a properties file is a comment line,
 * and if that line ends with end-of-file (no line terminator),
 * then that comment line is mistakenly loaded as a property.
 *

Rgds,

Markku

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


Re: using jdk1.5alpha for javac

Posted by Stefan Bodewig <bo...@apache.org>.
On Thu, 22 Jan 2004, James Black <jb...@ieee.org> wrote:

>   Everything works until I try source="1.5", then I get an error.

Without any warnings?  I'm surprised.  Maybe it's just the Linux
version that is unwilling to accept -source 1.3 or to create -target
1.1.

The short story is that there is no real support for JDK 1.5 yet.
I've added a few things to CVS HEAD but it is far from finished.

But at least Ant would detect Java 1.5 with this and allow -source
1.5, maybe I should merge the parts we have over to the 1.6 branch so
it gets into 1.6.1 - I don't see any chance of supporting the new
javac API, I've forgotten the JSR number, for the planned release
date.

Antoine, what do you think?  I'm talking about
<http://marc.theaimsgroup.com/?l=ant-dev&m=107349417004602&w=2>.

Stefan

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


Re: using jdk1.5alpha for javac

Posted by Antoine Lévy-Lambert <an...@antbuild.com>.
James Black wrote:

> Hello,
>  I am trying to figure out how to get the javac task to work, but I am 
> having a problem with one option.
>
>  I am trying
> <javac
>    fork="yes"
>    executable="/usr/j2sdk1.5.0/bin/javac"
>    source="1.5"
>    srcdir="...">
>
>
>  Everything works until I try source="1.5", then I get an error.
>
>  I want to start trying to use some of the new features (such as 
> autoboxing) and see if it works fine on the production server running 
> jdk1.4.2.
>
>   I can't just set my path to point to the 1.5 jdk because I have a 
> problem with junitreport, which appears to be a bug in xalan, so I 
> just want to compile with 1.5, then run my tests with 1.4.2.
>
>  Thank you for any suggestions.
>
>
>
I am not sure whether you need source="1.5"
fork="true" and executable="......" should be enough.

Just guessing, I did not do any java 1.5 compiles yet.

Antoine


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