在我的Java项目中,我尝试通过点击this链接将Java kinesis akka流添加为Source,但是他的项目无法编译;
Error:(22, 53) java: cannot access scala.Serializable
class file for scala.Serializable not found
在此行ShardSettings.create
final ShardSettings settings = ShardSettings.create("test-stream", "shard-id")
.withShardIteratorType(ShardIteratorType.LATEST)
.withRefreshInterval(1L, TimeUnit.SECONDS)
.withLimit(500);
我尝试将scala lang-library添加到我的build.gradle中,但是没有运气。这是我的build.gradle文件;
plugins {
id 'java'
id 'scala'
}
group 'org.example'
version '1.0-SNAPSHOT'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
implementation 'org.scala-lang:scala-library:2.12.10'
compile 'org.scala-lang:scala-library:2.12.10'
compile group: 'com.typesafe.akka', name: 'akka-stream_2.13', version: '2.6.1'
compile group: 'com.lightbend.akka', name: 'akka-stream-alpakka-kinesis_2.12', version: '0.17'
compile group: 'com.lightbend.akka', name: 'akka-stream-alpakka-s3_2.12', version: '1.1.2'
}
任何人都知道发生了什么事吗?