mercoledì 20 giugno 2012

Ant Build jre path problem

I was trying to compile the Apache Commons Math Library using Ant in Eclipse. The error I got was

bad class file: C:\Program Files\***\Java60\jre\lib\java.util.jar(java/util/Arrays.class)
    [javac] class file has wrong version 50.0, should be 49.0
    [javac] Please remove or make sure it appears in the correct subdirectory of the classpath.
    [javac] import java.util.Arrays;
This is because Ant is initializing a different process to compile the files, with a different (earlier) version of javac - don't ask me why.

To solve the problem, after selecting the build.xml file go to
Run -> External Tools -> External Tools Configurations... -> JRE
And select "Run in the same JRE as the workspace".


Nessun commento: