Why hamarin can't find my java sdk

Since I uninstalled 32-bit Java and installed 64-bit jdk and jre, xamarin can no longer find jdk. The xamarin build file generates the following error message ...

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

How to tell Xamarin the new location of my Jdk?

+6
source share
3 answers

Good, stupid of me. Xamarin not only requires Java, it requires 32-bit Java. 32 and 64 bit javas can live happily together. JAVA_HOME may indicate 64 bits if 32 is present. Reinstalling 32-bit Java fixed the problem. I hope this report on my stupidity will be useful to others :-)

+13
source

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

If you are using Visual Studio, you need to go to Tools -> Options , and then go 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.

+2
source

Set the JAVA_HOME environment variable to the root of your JDK. For example, the mine is set to

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

How to set the environment variable in Windows:

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

0
source

Source: https://habr.com/ru/post/974889/


All Articles