不支持使用 JDK 版本“11.0.1"构建.请安装JDK版本`1.8.0` [英] Building with JDK Version `11.0.1` is not supported. Please install JDK version `1.8.0`

查看:42
本文介绍了不支持使用 JDK 版本“11.0.1"构建.请安装JDK版本`1.8.0`的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经下载了 Visual Studio for mac 并尝试开始学习 xamarin is iOS 和 Android

I have downloaded visual studio for mac and try to start learning xamarin is iOS and Android

问题是当我尝试运行android项目时出现以下错误

the problem is when I try to run the android project I got the following error

Building with JDK Version `11.0.1` is not supported. Please install JDK version `1.8.0`

知道我已经安装了java 1.8.0,但是在终端上运行java --version 却看不到,只能看到11.0.1

knowing that I have installed java 1.8.0, but I can not see it when i run java --version on terminal, I can only see 11.0.1

推荐答案

您现在可以使用 Microsoft 版本的 OpenJDK 来避免使用系统安装的 Java 版本.Xamarin.Android 严格将其用于 MSBuild 进程,而不是任何正常"的 Java 开发.

You can now use Microsoft's version of OpenJDK to avoid using a system installed version of Java. This is strictly used by Xamarin.Android for the MSBuild processes and not any "normal" Java development.

从 Visual Studio 15.9 和 Visual Studio for Mac 7.7 开始,Visual Studio Tools for Xamarin 将从 Oracle 的 JDK 迁移到 OpenJDK 的轻量级版本,专用于 Android 开发:

Beginning with Visual Studio 15.9 and Visual Studio for Mac 7.7, Visual Studio Tools for Xamarin will move from Oracle’s JDK to a lightweight version of the OpenJDK that is intended solely for Android development:

  • https://docs.microsoft.com/en-us/xamarin/android/get-started/installation/openjdk
  • 此举的好处是:

    • 您将始终拥有适用于 Android 开发的 OpenJDK 版本.

      • You will always have an OpenJDK version that works for Android development.

        下载 JDK 9 或 10 不会影响开发体验.

        Downloading JDK 9 or 10 won’t affect the development experience.

        显着减少了下载大小和占用空间.

        Significantly reduced download size and footprint.

        第 3 方服务器和安装程序不再有问题.

        No more issues with 3rd party servers and installers.

        这篇关于不支持使用 JDK 版本“11.0.1"构建.请安装JDK版本`1.8.0`的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆