1

I'm running Xamarin 6.0.2 on Mac OS X El Capitan. I've installed Java version 8 and confirmed that it is running. However, when I attempt to point Xamarin (via tools >> SDK Manager) to the JDK for Java, the JDK file does not appear.

I confirmed the location of the JAVA sdk via terminal, which displayed the following: /usr/bin/java ...but no JDK

Manually via Finder, (command-shift-G) - I entered /usr/bin/java, the file displays, but it does not when I navigate there via Xamarin SDK manager

I also tried navigating to: Library/Java/JavaVirtualMachines/ ...but it just appears blank. (I've un-hidden all my files via terminal)

Could I please get some assistance as to what I may be doing wrong or over-looking? ...thanks in advance

Hikaiix
  • 70
  • 9
user1724708
  • 1,409
  • 7
  • 31
  • 53
  • I actually located the file 'Java_home' here: /System/Library/Frameworks/JavaVM.framework/Versions/A/Commands/ ...but it is dimmed out, could this be a permissions issue? any help is greatly appreciated. – user1724708 Aug 25 '16 at 17:19

1 Answers1

0

/usr/bin/java is a symbolic link, it's not the location of the Java SDK.

First check correctly the location of your JDK path with:
/usr/libexec/java_home -V

If it's showing you the path of JDK8 then you need to insert it in Xamarin under
SDK Locations -> Android -> Java SDK.
If it's not showing the JDK path, it seems to be a problem with your JDK installation.

I would suggest you to uninstall it correctly (thanks to Samuel Alpoim answer)

sudo rm -rf /Library/Java/JavaVirtualMachines/jdk<version>.jdk
sudo rm -rf /Library/PreferencePanes/JavaControlPanel.prefPane
sudo rm -rf /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
sudo rm -rf /Library/LaunchAgents/com.oracle.java.Java-Updater.plist
sudo rm -rf /Library/PrivilegedHelperTools/com.oracle.java.JavaUpdateHelper
sudo rm -rf /Library/LaunchDaemons/com.oracle.java.Helper-Tool.plist
sudo rm -rf /Library/Preferences/com.oracle.java.Helper-Tool.plist

and perform a new install of the JDK.

If you need to have multiple JDK versions make sure to check and export the correct version in the environment variable with:

export JAVA_HOME=`/usr/libexec/java_home -v 1.7`
Hichame Yessou
  • 2,658
  • 2
  • 18
  • 30