You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by nlif <na...@plimus.com> on 2008/10/22 16:24:45 UTC

javac source and target default values

Hi,

I suspect that although I use JDK 1.6 to run ANT's javac task, the
source/target compatability level is 1.5 and not 1.6. 

I know that I can -and should- specify them using the source and target
attributes, but I would like to know where from does ANT take the default
values for these attributes. 

Can anybody provide this information?

Thanks,
Naaman
-- 
View this message in context: http://www.nabble.com/javac-source-and-target-default-values-tp20111811p20111811.html
Sent from the Ant - Users mailing list archive at Nabble.com.


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


Re: javac source and target default values

Posted by Dave <da...@gmail.com>.
Hey Naaman,Ant uses whatever JDK JAVA_HOME is to.
if you type:
echo %JAVA_HOME%
on the command line, where does it point to?
Also do the following:
echo %PATH%

and see if there is any JDK 5\bin directory on the system path?

On Wed, Oct 22, 2008 at 5:23 PM, nlif <na...@plimus.com> wrote:

>
> javap says: major version = 50 minor = 0
> Anyway, I have other proof that it's compiling as 1.5, but what's bugging
> me
> is where the defaults come from...
>
>
>
>
> Toomey, Kevin H (ATS, IT) wrote:
> >
> > AFAIK, Ant doesn't supply default values. The default value are supplied
> > by Java, and the value is whatever version it is.
> >
> > I think you should first go back to the beginning and confirm your
> > suspicions that you are creating 1.5 byte code with a 1.6 JDK.
> >
> > Run a javap command against one of the classes you create (javap
> > -verbose this.package.myClass) and look at the "major version". 49=1.5,
> > 60=1.6
> >
> > Thanks,
> > Kevin
> >
> > -----Original Message-----
> > From: nlif [mailto:naamanl@plimus.com]
> > Sent: Wednesday, October 22, 2008 11:44 AM
> > To: user@ant.apache.org
> > Subject: Re: javac source and target default values
> >
> >
> > Thanks for the reply, but I already knew that :) What I am asking is
> > where does ANT take the DEFAULT values from.
> >
> > Thanks,
> >
> >
> >
> > Scot P. Floess wrote:
> >>
> >>
> >> Use the target attribute for the javac task.  target="1.5" for example
> >>
> >> On Wed, 22 Oct 2008, nlif wrote:
> >>
> >>>
> >>> Hi,
> >>>
> >>> I suspect that although I use JDK 1.6 to run ANT's javac task, the
> >>> source/target compatability level is 1.5 and not 1.6.
> >>>
> >>> I know that I can -and should- specify them using the source and
> >>> target attributes, but I would like to know where from does ANT take
> >>> the default values for these attributes.
> >>>
> >>> Can anybody provide this information?
> >>>
> >>> Thanks,
> >>> Naaman
> >>> --
> >>> View this message in context:
> >>> http://www.nabble.com/javac-source-and-target-default-values-tp201118
> >>> 11p20111811.html Sent from the Ant - Users mailing list archive at
> >>> Nabble.com.
> >>>
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For
> >>> additional commands, e-mail: user-help@ant.apache.org
> >>>
> >>>
> >>
> >> Scot P. Floess
> >> 27 Lake Royale
> >> Louisburg, NC  27549
> >>
> >> 252-478-8087 (Home)
> >> 919-754-4592 (Work)
> >>
> >> Chief Architect JPlate   http://sourceforge.net/projects/jplate
> >> Chief Architect JavaPIM  http://sourceforge.net/projects/javapim
> >>
> >> Architect Keros          http://sourceforge.net/projects/keros
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional
> >
> >> commands, e-mail: user-help@ant.apache.org
> >>
> >>
> >>
> >
> > --
> > View this message in context:
> > http://www.nabble.com/javac-source-and-target-default-values-tp20111811p
> > 20113677.html
> > Sent from the Ant - Users mailing list archive at Nabble.com.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > For additional commands, e-mail: user-help@ant.apache.org
> >
> >
> >
> > *************************************************************************
> > This communication, including attachments, is
> > for the exclusive use of addressee and may contain proprietary,
> > confidential and/or privileged information.  If you are not the intended
> > recipient, any use, copying, disclosure, dissemination or distribution is
> > strictly prohibited.  If you are not the intended recipient, please
> notify
> > the sender immediately by return e-mail, delete this communication and
> > destroy all copies.
> > *************************************************************************
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > For additional commands, e-mail: user-help@ant.apache.org
> >
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/javac-source-and-target-default-values-tp20111811p20114560.html
> Sent from the Ant - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>


-- 
"A lot of people are afraid of heights. Not me, I'm afraid of widths."

RE: javac source and target default values

Posted by nlif <na...@plimus.com>.
javap says: major version = 50 minor = 0 
Anyway, I have other proof that it's compiling as 1.5, but what's bugging me
is where the defaults come from...




Toomey, Kevin H (ATS, IT) wrote:
> 
> AFAIK, Ant doesn't supply default values. The default value are supplied
> by Java, and the value is whatever version it is. 
> 
> I think you should first go back to the beginning and confirm your
> suspicions that you are creating 1.5 byte code with a 1.6 JDK.
> 
> Run a javap command against one of the classes you create (javap
> -verbose this.package.myClass) and look at the "major version". 49=1.5,
> 60=1.6
> 
> Thanks,
> Kevin
> 
> -----Original Message-----
> From: nlif [mailto:naamanl@plimus.com] 
> Sent: Wednesday, October 22, 2008 11:44 AM
> To: user@ant.apache.org
> Subject: Re: javac source and target default values
> 
> 
> Thanks for the reply, but I already knew that :) What I am asking is
> where does ANT take the DEFAULT values from.
> 
> Thanks,
> 
> 
> 
> Scot P. Floess wrote:
>> 
>> 
>> Use the target attribute for the javac task.  target="1.5" for example
>> 
>> On Wed, 22 Oct 2008, nlif wrote:
>> 
>>>
>>> Hi,
>>>
>>> I suspect that although I use JDK 1.6 to run ANT's javac task, the 
>>> source/target compatability level is 1.5 and not 1.6.
>>>
>>> I know that I can -and should- specify them using the source and 
>>> target attributes, but I would like to know where from does ANT take 
>>> the default values for these attributes.
>>>
>>> Can anybody provide this information?
>>>
>>> Thanks,
>>> Naaman
>>> --
>>> View this message in context:
>>> http://www.nabble.com/javac-source-and-target-default-values-tp201118
>>> 11p20111811.html Sent from the Ant - Users mailing list archive at 
>>> Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For 
>>> additional commands, e-mail: user-help@ant.apache.org
>>>
>>>
>> 
>> Scot P. Floess
>> 27 Lake Royale
>> Louisburg, NC  27549
>> 
>> 252-478-8087 (Home)
>> 919-754-4592 (Work)
>> 
>> Chief Architect JPlate   http://sourceforge.net/projects/jplate
>> Chief Architect JavaPIM  http://sourceforge.net/projects/javapim
>> 
>> Architect Keros          http://sourceforge.net/projects/keros
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional
> 
>> commands, e-mail: user-help@ant.apache.org
>> 
>> 
>> 
> 
> --
> View this message in context:
> http://www.nabble.com/javac-source-and-target-default-values-tp20111811p
> 20113677.html
> Sent from the Ant - Users mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
> 
> 
> *************************************************************************
> This communication, including attachments, is
> for the exclusive use of addressee and may contain proprietary,
> confidential and/or privileged information.  If you are not the intended
> recipient, any use, copying, disclosure, dissemination or distribution is
> strictly prohibited.  If you are not the intended recipient, please notify
> the sender immediately by return e-mail, delete this communication and
> destroy all copies.
> *************************************************************************
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/javac-source-and-target-default-values-tp20111811p20114560.html
Sent from the Ant - Users mailing list archive at Nabble.com.


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


RE: javac source and target default values

Posted by "Toomey, Kevin H (ATS, IT)" <Ke...@thehartford.com>.
AFAIK, Ant doesn't supply default values. The default value are supplied
by Java, and the value is whatever version it is. 

I think you should first go back to the beginning and confirm your
suspicions that you are creating 1.5 byte code with a 1.6 JDK.

Run a javap command against one of the classes you create (javap
-verbose this.package.myClass) and look at the "major version". 49=1.5,
60=1.6

Thanks,
Kevin

-----Original Message-----
From: nlif [mailto:naamanl@plimus.com] 
Sent: Wednesday, October 22, 2008 11:44 AM
To: user@ant.apache.org
Subject: Re: javac source and target default values


Thanks for the reply, but I already knew that :) What I am asking is
where does ANT take the DEFAULT values from.

Thanks,



Scot P. Floess wrote:
> 
> 
> Use the target attribute for the javac task.  target="1.5" for example
> 
> On Wed, 22 Oct 2008, nlif wrote:
> 
>>
>> Hi,
>>
>> I suspect that although I use JDK 1.6 to run ANT's javac task, the 
>> source/target compatability level is 1.5 and not 1.6.
>>
>> I know that I can -and should- specify them using the source and 
>> target attributes, but I would like to know where from does ANT take 
>> the default values for these attributes.
>>
>> Can anybody provide this information?
>>
>> Thanks,
>> Naaman
>> --
>> View this message in context:
>> http://www.nabble.com/javac-source-and-target-default-values-tp201118
>> 11p20111811.html Sent from the Ant - Users mailing list archive at 
>> Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For 
>> additional commands, e-mail: user-help@ant.apache.org
>>
>>
> 
> Scot P. Floess
> 27 Lake Royale
> Louisburg, NC  27549
> 
> 252-478-8087 (Home)
> 919-754-4592 (Work)
> 
> Chief Architect JPlate   http://sourceforge.net/projects/jplate
> Chief Architect JavaPIM  http://sourceforge.net/projects/javapim
> 
> Architect Keros          http://sourceforge.net/projects/keros
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional

> commands, e-mail: user-help@ant.apache.org
> 
> 
> 

--
View this message in context:
http://www.nabble.com/javac-source-and-target-default-values-tp20111811p
20113677.html
Sent from the Ant - Users mailing list archive at Nabble.com.


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



*************************************************************************
This communication, including attachments, is
for the exclusive use of addressee and may contain proprietary,
confidential and/or privileged information.  If you are not the intended
recipient, any use, copying, disclosure, dissemination or distribution is
strictly prohibited.  If you are not the intended recipient, please notify
the sender immediately by return e-mail, delete this communication and
destroy all copies.
*************************************************************************


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


Re: javac source and target default values

Posted by nlif <na...@plimus.com>.
Thanks for the reply, but I already knew that :) 
What I am asking is where does ANT take the DEFAULT values from.

Thanks,



Scot P. Floess wrote:
> 
> 
> Use the target attribute for the javac task.  target="1.5" for example
> 
> On Wed, 22 Oct 2008, nlif wrote:
> 
>>
>> Hi,
>>
>> I suspect that although I use JDK 1.6 to run ANT's javac task, the
>> source/target compatability level is 1.5 and not 1.6.
>>
>> I know that I can -and should- specify them using the source and target
>> attributes, but I would like to know where from does ANT take the default
>> values for these attributes.
>>
>> Can anybody provide this information?
>>
>> Thanks,
>> Naaman
>> -- 
>> View this message in context:
>> http://www.nabble.com/javac-source-and-target-default-values-tp20111811p20111811.html
>> Sent from the Ant - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>> For additional commands, e-mail: user-help@ant.apache.org
>>
>>
> 
> Scot P. Floess
> 27 Lake Royale
> Louisburg, NC  27549
> 
> 252-478-8087 (Home)
> 919-754-4592 (Work)
> 
> Chief Architect JPlate   http://sourceforge.net/projects/jplate
> Chief Architect JavaPIM  http://sourceforge.net/projects/javapim
> 
> Architect Keros          http://sourceforge.net/projects/keros
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/javac-source-and-target-default-values-tp20111811p20113677.html
Sent from the Ant - Users mailing list archive at Nabble.com.


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


Re: javac source and target default values

Posted by "Scot P. Floess" <fl...@mindspring.com>.
Use the target attribute for the javac task.  target="1.5" for example

On Wed, 22 Oct 2008, nlif wrote:

>
> Hi,
>
> I suspect that although I use JDK 1.6 to run ANT's javac task, the
> source/target compatability level is 1.5 and not 1.6.
>
> I know that I can -and should- specify them using the source and target
> attributes, but I would like to know where from does ANT take the default
> values for these attributes.
>
> Can anybody provide this information?
>
> Thanks,
> Naaman
> -- 
> View this message in context: http://www.nabble.com/javac-source-and-target-default-values-tp20111811p20111811.html
> Sent from the Ant - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

Scot P. Floess
27 Lake Royale
Louisburg, NC  27549

252-478-8087 (Home)
919-754-4592 (Work)

Chief Architect JPlate   http://sourceforge.net/projects/jplate
Chief Architect JavaPIM  http://sourceforge.net/projects/javapim

Architect Keros          http://sourceforge.net/projects/keros

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