Mac JDK error on build

I have made my game and tested it out but recently I encountered a problem with the JDK saying ‘Please make sure you have a suitable JDK installation. Android development requires at least JDK 7 (1.7), having JRE only is not enough. The latest JDK can be obtained from the Oracle website
http://www.oracle.com/technetwork/java/javase/downloads/index.html’ and when I try setting the JDK home manually, it returns with the same error message

  • On mac
  • Tried reinstalling JDK
  • JDK VERSION = jdk1.7.0_79.jdk

Thanks for any help in advance

I was having a similar problem because I did not realise you have to point it to the home folder in the contents of the jdk folder, so my full address was: /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home
Hope this helps

Are you sure you have a correct version of JDK installed ?

You can verify that on MacOS by navigating to the following location:
/Library/Java/JavaVirtualMachines

Make sure you have a valid JDK installation there (1.7 or above).

Also, make sure that Unity picks up on your JDK version. This can be found under Unity → Preferences → External Tools: