对于最新版本的 Kafka 0.8.1.1 和 gradlew,“SCALA_VERSION”是脚本中的一个变量。
SCALA_VERSION=2.10.4
但是,在某处出现问题后:
``` ./gradlew -PscalaVersion=2.10.4 jar
```
其中一个文件没有2.10.4部分,但只有 2.10 :
peter_v@trusty64:~/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 名称的副本作为解决方法,Kafka 正确启动。
```
cp core/build/libs/kafka_2.10-0.8.1.1.jar core/build/libs/kafka_2.10.4-0.8.1.1.jar ```