【问题标题】:Error:(24, 46) error: diamond operator is not supported in -source 1.6 (use -source 7 or higher to enable diamond operator)错误:(24, 46) 错误:-source 1.6 不支持菱形运算符(使用 -source 7 或更高版本启用菱形运算符)
【发布时间】:2014-09-28 04:56:58
【问题描述】:

我的ArrayAdapter<> 出现错误

listView.setAdapter(new ArrayAdapter<>(this,android.R.layout.simple_list_item_1,name1));

Error:(24, 46) 错误:-source 1.6 中不支持菱形运算符 (使用 -source 7 或更高版本来启用菱形运算符)

然后我将我的 java 版本更新为

java version "1.7.0_67" 

但我仍然遇到同样的错误。 操作系统我使用的是 ubuntu 14.04。

【问题讨论】:

  • 你必须更新你的ide的语言级别,而不仅仅是你的jdk。
  • Eclipse 你用的是什么IDE?
  • no.Android Studio (Beta)0.8.2
  • @PsHegger 如何更新我的 ide 的语言级别?

标签: java android ubuntu-14.04


【解决方案1】:

现在有了Android Studio(我用的是v1.1),你可以通过点击File->Project Structure轻松更改你的语言级别,并在打开的窗口中进行设置:

【讨论】:

    猜你喜欢
    • 2023-03-20
    • 2015-05-29
    • 2018-04-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-05-21
    • 2021-10-30
    • 1970-01-01
    相关资源
    最近更新 更多