bbsimonbb
bbsimonbb

Reputation: 29012

Why can't xamarin locate my java sdk

Since I uninstalled 32 bit java and installed 64 bit jdk and jre, xamarin can no longer find the jdk. The xamarin build file generates the following errror...

2>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(349,2): error : Could not locate Java 6 or 7 SDK. (Download from http://www.oracle.com/technetwork/java/javase/downloads.)

How do I tell Xamarin the new location of my Jdk?

Upvotes: 7

Views: 10164

Answers (3)

bbsimonbb
bbsimonbb

Reputation: 29012

Ok silly me. Xamarin doesn't just require java, it requires 32 bit java. 32 and 64 bit javas can live happily together. The JAVA_HOME can point to the 64 bit, so long as the 32 is present. Reinstalling 32 bit java fixed the problem. Hopefully this record of my silliness will be useful to others :-)

Upvotes: 14

jensendp
jensendp

Reputation: 2135

If you are using Xamarin Studio, you will need to go to Xamarin Studio -> Preferences -> Android, then under the Projects section on the left, expand SDK Locations. Here you can update the location of the SDK and the NDK.

If you are using Visual Studio, you will need to go to Tools -> Options, then navigate down to the Xamarin section. Expand Xamarin and select Android. Here you can update the location of the SDK and NDK.

This process may require a restart of Xamarin Studio or Visual Studio for the changes to take effect.

Upvotes: 3

mdzh
mdzh

Reputation: 1050

Set the JAVA_HOME environment variable to the root of your JDK. Mine for example is set to

JAVA_HOME="C:\Program Files\Java\jdk1.7.0_21"

How to set Environment Variable in Windows:

http://www.computerhope.com/issues/ch000549.htm

Upvotes: 0

Related Questions