【问题标题】:Can not resolve "$" underscore-java(java port for underscore.js)无法解析 "$" underscore-java(下划线.js 的 java 端口)
【发布时间】:2015-09-17 07:12:03
【问题描述】:
$.each(asList(1, 2, 3), new Block<Integer>() {
    public void apply(Integer item) {
        System.out.println(item + ",");
    }
});

它抛出无法解析“$”的错误 我正在使用 underscore-java 1.6

【问题讨论】:

  • 请出示您的进口声明。
  • 您是否导入了所需的正确 jar 文件?另外,note 如果您想要underscore.js 行中的某些内容,您还可以尝试Stream API,它适用于Java 8(如果您使用的是Java 8)
  • @Thilo - import com.github.underscore.Block 这是我能看到的唯一导入:

标签: java underscore-java


【解决方案1】:

你需要import com.github.underscore.$;

【讨论】:

  • 谢谢它现在很好
  • com.github.underscore.$ 更名为 com.github.underscore.U.
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2023-03-03
  • 1970-01-01
  • 2019-05-15
  • 1970-01-01
  • 2016-01-15
  • 2014-10-10
  • 2013-07-13
相关资源
最近更新 更多