[
https://issues.apache.org/jira/browse/THRIFT-482?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12705887#action_12705887
]
Jarret Falkner commented on THRIFT-482:
---------------------------------------
Yep, it's pretty much a lazy 'this is java 6' without feature inspection.
If Ant's javac task does not contain a java class version target, ant defaults
to the compiling JDK's version. So, in a java 6 environment, you get java 6
class files (even when the javac task is forced to require source code version
5 or lower).
This is definitely an Ant 'gotcha' - they strongly recommend setting something
as the target for javac tasks, otherwise you end up with class files that are
not backwards compatible to the source without good reason.
Here's the pointer to the Ant manual with their recommendation:
http://ant.apache.org/manual/CoreTasks/javac.html
> build.xml does not specify a target version for compiled java classes
> ---------------------------------------------------------------------
>
> Key: THRIFT-482
> URL: https://issues.apache.org/jira/browse/THRIFT-482
> Project: Thrift
> Issue Type: Bug
> Environment: java version "1.6.0_13"
> Java(TM) SE Runtime Environment (build 1.6.0_13-b03)
> Java HotSpot(TM) 64-Bit Server VM (build 11.3-b02, mixed mode)
> Reporter: Jarret Falkner
> Attachments: java5_target.patch
>
>
> When building thrift in a java 6 environment, the packaged libthrift.jar
> contains classes for version 6 java. The compile target in build.xml should
> make java version 5 class files to maintain compatibility with earlier
> runtime environments.
> The attached patch should update build.xml with the desired behavior.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.