invalid target release errors while compiling library

hello, im trying to compile a library on osx yosemite 10.10.5 with java 1.8.0_91 using eclipse but i can't figure out how to fix this error:

[javac] javac: invalid target release: 1.7 [javac] Usage: javac [javac] use -help for a list of possible options

i have eclipse preference->java->compiler compliance level set to 1.7 (theres no option for 1.8) and eclipse preference->java->installed jres set to Java 1.8.0_73

im just now seeing that there are 2 versions of 1.8 installed somehow. has anyone else run into these issues

Tagged:

Answers

  • It is possible for several version of Java to be installed, on mine I have 5 different versions. :)

    The target release is specified in the build.properties file and should be 1.7

    A Java project can specify 2 different JREs.

    The first is the one on the build path and you can see this in the Package Explorer view of the Project. This is the version used inside Eclipse when the project is used inside Eclipse. I have another Project for creating examples, tests etc for my libraries, I link the library project into my test project. I am able to use both 1.7.0_71 and 1.8.0_66 without error.

    The second is the one used when building the Project. Click on the arrow on the side of the Run Configuration tool on the menu

    exttools

    and select External Tools Configuration ... in the window that opens select your project and then the JRE tab and see what you are using. When I tried 1.8.0 the build failed but worked fine with 1.7.0

    exttools2

  • edited July 2016
  • that worked. thanks!!!

Sign In or Register to comment.