我正在使用 Mac OS X,我的 ant,java 依赖项满足了最低要求。当我通过
构建源代码时ant build
我得到了这样的错误:
[echo] apache-cassandra: /Users/taiyuanz/git/cassandra-trunk/build.xml
[javac] Compiling 890 source files to /Users/taiyuanz/git/cassandra-trunk/build/classes/main
[javac] Note: Processing compiler hints annotations
[javac] warning: Supported source version 'RELEASE_6' from annotation processor 'org.openjdk.jmh.generators.BenchmarkProcessor' less than -source '1.8'
[javac] /Users/taiyuanz/git/cassandra-trunk/src/java/org/apache/cassandra/db/partitions/AbstractBTreePartition.java:33: error: reference to Row is ambiguous
[javac] public abstract class AbstractBTreePartition implements Partition, Iterable<Row>
[javac] ^
[javac] both interface org.apache.cassandra.db.rows.Row in org.apache.cassandra.db.rows and class org.apache.cassandra.db.Row in org.apache.cassandra.db match
[javac] /Users/taiyuanz/git/cassandra-trunk/src/java/org/apache/cassandra/db/partitions/PartitionUpdate.java:72: error: reference to Row is ambiguous
[javac] private BTree.Builder<Row> rowBuilder;
[javac] ^
[javac] both interface org.apache.cassandra.db.rows.Row in org.apache.cassandra.db.rows and class org.apache.cassandra.db.Row in org.apache.cassandra.db match
[javac] /Users/taiyuanz/git/cassandra-trunk/src/java/org/apache/cassandra/db/partitions/PartitionUpdate.java:164: error: reference to Row is ambiguous
[javac] public static PartitionUpdate singleRowUpdate(CFMetaData metadata, DecoratedKey key, Row row)
.......
都是因为同一个问题——Row 类导致的歧义。如何解决这个问题?
最佳答案
看起来您的源代码树中有来自 3.0 之前和 3.0 之后的 Cassandra 的源代码。我会跑:
git clean -xfd
看看是否修复了它。否则,删除存储库并使用干净的克隆重新开始。
关于java - 无法从源代码构建 Cassandra,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34080767/