-1

I am trying to download Java 7 on my mac. All my professors require java code to be in Java 7. I have the dmg downloaded but when I double click the icon to install I get the error message :

A newer version of Java is already installed.

The only thing I can do is click close and it exits the install. How can I install Java 7 onto my machine?

  • 1
    You can run Java 7 code on Java 8. – SLaks Aug 31 '16 at 00:34
  • If you are very particular about "Java 7", you could uninstall Java 8 and install Java 7. The other way is download the tar.gz file, open it where you want to install, set your path and work with it. – blackpen Aug 31 '16 at 00:52
  • "Teaching Java7 in 2016"; that sounds like "sub-standard" to me. Tell your professors that Java8 adds a whole lot of features that are extremely helpful about Java; even from a "conceptual teaching" point of view. – GhostCat Aug 31 '16 at 01:53

1 Answers1

0

If you are doing your "development" using an IDE like eclipse, there is a simple solution to your problem: within eclipse, you can change the "compatibility" mode for your projects.

Meaning - even when only Java8 is installed, you can instruct eclipse that your project should be using Java7 only. So when you write source code that uses Java8 features (like lambdas or such things); you will get compiler errors.

The only caveat: you still could be using classes/methods from the Java8 installation that don't exist in Java7.

GhostCat
  • 137,827
  • 25
  • 176
  • 248