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


    [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


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

Total time: 285 milliseconds

After some searching

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.


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.


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



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s