简体   繁体   English

在Visual Studio 2015上运行xamarin的问题“无法找到Java 6或7 SDK”

[英]issue at running xamarin on visual studio 2015 “Could not locate Java 6 or 7 SDK”

I try to install visual studio 2015 with xamarin by these following step 我尝试通过以下步骤安装带有xamarin的visual studio 2015

  1. install VS 2015 for mobile application 安装VS 2015 for mobile application
    1. install Java JDK 8 for both version 64 & 86 为版本64和86安装Java JDK 8
    2. update android SDK to be V26 将android SDK更新为V26

But I am still have issue , visual studio couldn't see java SDK with populate this error at running "Could not locate Java 6 or 7 SDK" although try these following items to fix this issue. 但我仍然有问题,Visual Studio无法看到java SDK在运行“无法找到Java 6或7 SDK”时填充此错误,尽管尝试以下项目来解决此问题。

  1. install JDK 8 for 64 , 86 安装JDK 8 for 64,86
  2. add JAVA_HOME at Environment variable at windows as following snapshot (Java_Home Config) 在Windows的Environment变量中添加JAVA_HOME作为以下快照(Java_Home Config)

    [1]

  3. add JAVA BIN path to Path environment variable at windows as following snapshot (Path config) 在Windows 上将JAVA BIN路径添加到Path环境变量,如下面的快照(Path config)

    [2]

  4. make sure Java JDK is defined at Xamarin configuration 确保在Xamarin配置中定义Java JDK

Could not locate Java 6 or 7 SDK . 无法找到Java 6或7 SDK

You have Java 8. Android does not (yet) fully support Java 8. 你有Java 8. Android(尚未)完全支持Java 8。

Also, why do you have 32bit and 64bit java in your path? 另外,为什么你的路径中有32位和64位java? You only need %JAVA_HOME%\\bin in the path. 您只需要路径中的%JAVA_HOME%\\bin

I found the solution for Could not locate Java 6 or 7 SDK . 我找到了Could not locate Java 6 or 7 SDK的解决方案。

After 2 days of a hard battle with Visual Studio 2015 Community, this solution was found: 在与Visual Studio 2015社区进行了2天的艰苦斗争之后,找到了以下解决方案:

First, You need to download and install Java SE Development Kit 7 from oracle archives (an account needed to download package). 首先,您需要从oracle archives(下载软件包所需的帐户)下载并安装Java SE Development Kit 7。 In my case I downloaded 32 bit version. 在我的情况下,我下载了32位版本。

If You don't have Android NDK, download it from Android web page (Check if NDK is set in Tools -> Options -> Xamarin -> Android Settings). 如果您没有Android NDK,请从Android网页下载(检查NDK是否在工具 - >选项 - > Xamarin - > Android设置中设置)。

After those steps restart Visual Studio. 在这些步骤后重新启动Visual Studio。

VS should automatically find java jdk path. VS应该自动找到java jdk路径。 You can check it in Tools -> Options -> Xamarin -> Android Settings. 您可以在工具 - >选项 - > Xamarin - > Android设置中查看它。 If Android NDK location is not found, then provide the path to te package you downloaded from Android website. 如果找不到Android NDK位置,请提供从Android网站下载的te包的路径。

The last and key step is to go to Build and choose Clean solution. 最后一步和关键步骤是转到Build并选择Clean solution。

After that you can try to build your solution and it should works like a charm. 之后,您可以尝试构建您的解决方案,它应该像魅力一样。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM