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

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s