2

I have many legacy java 6 projects and I need to build it.

Using Eclipse Neon Ant plugin with Java 8 is building the jar, but when I use the generated jar with another Java 6 project, I have the problem 'Unsupported major.minor version 52.0'.

My solution is install Ant version compatible with Java 6 and build the project out of Eclipse.

Wendel
  • 2,809
  • 29
  • 28

1 Answers1

1

It doesn't matter what version of Ant you use or what version of Java it was compiled with.

What matters is the JDK that the Ant javac task uses and the values of the source and target arguments of the javac task.

When running Ant from Eclipse you can set the JDK used in the 'JRE' tab of the 'Ant Build' you are using in the 'Run > External Tools Configuration' dialog. Choose a Java 6 JDK.

Specify source="1.6" target="1.6" on the javac task in your Ant build.xml.

The Impaler
  • 45,731
  • 9
  • 39
  • 76
greg-449
  • 109,219
  • 232
  • 102
  • 145