Project "MyProject" has higher compiler option than running Eclipse

7.9k views Asked by At

I am trying to rebuild Hibernate configuration but i got Wrong Compiler Settings error, please find below screenshots of my App configuration and a of the error:

Error Message

Build Path

Java Compiler

2

There are 2 answers

0
Tarik On BEST ANSWER

The problem was because Eclipse ran on a different JVM than the one specified in my project (I have two installed JDK on my machine), to resolve that i just modified the file eclipse.init in a way to ensure Eclipse will run the appropriate JVM.

This is what i added to eclipse.init (you need to use your exact path to javaw.exe):

-vm
C:\Program Files\Java\jdk1.6.0_45\bin\javaw.exe

Further informations regarding the eclipse.init file, could be found here.

1
Muhammad Hamed On

It seems that you are using maven so you need to adjust it in the compile plugin it your POM

   <project>
  [...]
  <build>
    [...]
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.2</version>
        <configuration>
          <source>1.6</source>
          <target>1.6</target>
        </configuration>
      </plugin>
    </plugins>
    [...]
  </build>
  [...]
</project>

for more details check this example