使用最新版本的Kafka 0.8.1.1和gradlew,「SCALA_VERSION」是腳本中的一個變量。
SCALA_VERSION = 2.10.4
然而,地方出了差錯後:
``` ./gradlew -PscalaVersion = 2.10.4罐子
```
其中有一個文件是不是有2.10.4部分,但只有2.10:
[email protected]:~/data/kafka/kafka-0.8.1.1-src$ find . -name '*.jar' ./perf/build/libs/kafka-perf_2.10-0.8.1.1.jar ./clients/build/libs/kafka-clients-0.8.1.1.jar ./system_test/migration_tool_testsuite/0.7/lib/kafka-perf-0.7.0.jar ./system_test/migration_tool_testsuite/0.7/lib/kafka-0.7.0.jar ./system_test/migration_tool_testsuite/0.7/lib/zkclient-0.1.jar ./examples/build/libs/kafka-examples-0.8.1.1.jar ./core/build/libs/kafka_2.10-0.8.1.1.jar ############ 2.10 instead of 2.10.4 ? ./core/build/dependant-libs-2.10.4/snappy-java-1.0.5.jar ./core/build/dependant-libs-2.10.4/metrics-core-2.2.0.jar ./core/build/dependant-libs-2.10.4/zkclient-0.3.jar ./core/build/dependant-libs-2.10.4/log4j-1.2.15.jar ./core/build/dependant-libs-2.10.4/slf4j-api-1.7.2.jar ./core/build/dependant-libs-2.10.4/zookeeper-3.3.4.jar ./core/build/dependant-libs-2.10.4/jopt-simple-3.2.jar ./core/build/dependant-libs-2.10.4/scala-library-2.10.4.jar ./target/scala-2.10/kafka-0-8-1-1-src_2.10-0.1-SNAPSHOT.jar ./lib/apache-rat-0.8.jar ./contrib/hadoop-consumer/lib/piggybank.jar ./contrib/hadoop-consumer/build/libs/kafka-hadoop-consumer-0.8.1.1.jar ./contrib/hadoop-producer/lib/piggybank.jar ./contrib/hadoop-producer/build/libs/kafka-hadoop-producer-0.8.1.1.jar ./contrib/build/libs/contrib-0.8.1.1.jar ./gradle/wrapper/gradle-wrapper.jar
作爲解決方法,拷貝到2.10.4名稱,卡夫卡開始正確。
```
CP芯/建造/庫/ kafka_2.10-0.8.1.1.jar芯/建造/庫/ kafka_2.10。4-0.8.1.1.jar ```
謝謝你,那完美無瑕。 – twes