RE: Ant build - specifying target Java version

"Jan Tosovsky" <[email protected]>
Newsgroups gmane.text.xml.batik.devel
Message-ID <[email protected]>
On 2016-12-20 Glenn Adams wrote:
> On 2016-12-20 Jan Tosovsky wrote:
> >
> > I am trying to modify build.xml config to produce bytecode
> > compatible with JDK 1.7.
> > 
> > So far I tried:
> > 
> > (1) compile on JDK 8 with modifying all <javac> tasks to 
> >     <javac target="1.7" ...>
> > (2) compile on JDK 8 with global param <property
> >     name="ant.build.javac.target" value="1.7" />
> > (3) same as above with older Ant version to avoid possible
> >     issue: https://bz.apache.org/bugzilla/show_bug.cgi?id=59683
> > (4) compile on JDK 7u80
> >
> > Nothing helped. Especially the last item is very suspicious.
>
> Use -d on ant to find problems during ant build.

Nothing new has been displayed.

> Try using JDK 7 to do compile for 1.7 target, instead of using JDK 8.

I did exactly this in (4) and now retested again. It is really weird.

While in MANIFEST can be found 'created by' JDK 7, when that main class is executed in JDK 7, it fails (unsupported major.minor 52).

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.9.6
Created-By: 1.7.0_80-b15 (Oracle Corporation)
Implementation-Title: Batik SVG rasterizer
Implementation-Version: svn-trunk
Implementation-Vendor: The Apache Software Foundation (http://xmlgraph
 ics.apache.org/batik/)
Main-Class: org.apache.batik.apps.rasterizer.Main
Build-Id: 20161220-223305-CET (Honza [Windows 8.1 6.3 amd64, Java 1.7.
 0_80-b15])

I suspect this is Ant/compiler issue of incorectly written version stamp into class files.

I'll ask Ant developers.

Jan
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.