Wednesday, November 16, 2011

Ant Error: Error starting modern compiler

I setup an eclipse project in myeclipse for spring and I received the following error when trying to build the spring core project using Ant build:

Buildfile: C:\Projects\ProjectName\projectSpringCore\build.xml

compile:

    [mkdir] Created dir: C:\Projects\ProjectName\projectSpringCore\build

     [copy] Copying 20 files to C:\Projects\ProjectName\projectSpringCore\build

    [javac] Compiling 17 source files to C:\Projects\ProjectName\projectSpringCore\build

BUILD FAILED

C:\Projects\ProjectName\projectSpringCore\build.xml:25: Error starting modern compiler

Total time: 285 milliseconds

After some searching

http://www.myeclipseide.com/index.php?name=PNphpBB2&file=viewtopic&t=17956

This can arise for different reasons – though generally these reasons are all related – the version of Java being used by the Ant compiler in IDE does not match that already and referred to in JAVA_HOME.

image

To solve this in Eclipse, Go to Run > External Tools > External Tools Configurations > JRE

Select Separate JRE and match that with the one selected as JAVA_HOME.

image

You can verify the selected Java is the same using the Installed JREs tab

image

No comments:

Post a Comment

Thank you for your feedback