java.lang.UnsupportedClassVersionError:com/google/doclava/Doclava:不支持的major.minor版本51.0 android build [英] java.lang.UnsupportedClassVersionError: com/google/doclava/Doclava : Unsupported major.minor version 51.0 android build

查看:156
本文介绍了java.lang.UnsupportedClassVersionError:com/google/doclava/Doclava:不支持的major.minor版本51.0 android build的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从Google来源通过自己的AOSP构建.我遵循了Google文档中提到的步骤,并能够成功构建它并成功将图像与设备刷新.但是,在进行了一些更改之后(基本上只是添加了一些日志来尝试使用它),我尝试再次构建它.生成错误.然后,我尝试再次制作,发现找到 Javac 1.6.必需的Javac 1.7 .然后,我通过使用以下命令来遵循针对此特定问题的答案:

I am trying to build by own AOSP from google source. I follwed the steps mentioned in the Google Documents and was successfully able to build it and flash my device with the images successfully. However, I tried building it again after making some changes (basically just added some Logs to play around with it). The build errored out. I then tried to make again, it said Javac 1.6 found. Required Javac 1.7. I then followed the answers for this particular problem by using the following command:

 update-alternatives --config javac
There are 2 choices for the alternative javac (providing /usr/bin/javac).

  Selection    Path                                         Priority   Status
------------------------------------------------------------
  0            /usr/lib/jvm/java-7-openjdk-amd64/bin/javac   1051      auto mode
* 1            /usr/lib/jvm/j2sdk1.6-oracle/bin/javac        315       manual mode
  2            /usr/lib/jvm/java-7-openjdk-amd64/bin/javac   1051      manual mode

然后我选择了选项0.然后我尝试再次进行选择.这次它失败,并显示以下错误:

I then selected the option 0. I then tried to make again. This time it failed with the following error:

java.lang.UnsupportedClassVersionError: com/google/doclava/Doclava : Unsupported major.minor version 51.0 android build

在经历了所有问题的答案之后(我发现这个问题问了很多遍),我发现这是因为JDK的编译时间(较高版本)和运行时间(较低版本)不匹配,我应该使用Java 1.7.我该如何针对android构建?我也很惊讶为什么出现错误找到Javac 1.6.需要Javac 1.7".因为我使用Java 1.6成功创建了构建.

After going through the all answers for this question(I found this asked so many times), I found it is because the complie time(higher version) and run time(lower version) JDK dont match and I should recompile it using Java 1.7. How do I do that for android build? I am also surprized why I got the error "Javac 1.6 found. Required Javac 1.7." as I successfully created the build using Java 1.6.

推荐答案

在这种情况下,javac并不是问题,而是javadoc. 要检查其版本:javadoc -J-version(是的,很奇怪).

In this case it's not the problem with javac, but with javadoc. To check its version: javadoc -J-version (yes, it's weird).

因此,您必须使用:

update-alternatives --config javadoc

这篇关于java.lang.UnsupportedClassVersionError:com/google/doclava/Doclava:不支持的major.minor版本51.0 android build的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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