The Java/Kotlin application runs as expected in from the Main Class in IntelliJ\'s IDE. However, when the app is built into a .Jar file the
The Jar build started working again after updating my library dependencies and redefining the Project level SDK when re-pulling a version built on a different machine from Github.
compile
to implementation
.buildscript {
ext.kotlin_version = '1.3.10'
ext.junitJupiterVersion = '5.3.2'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'org.junit.platform:junit-platform-gradle-plugin:1.0.3'
}
}
plugins {
id 'java'
id 'org.jetbrains.kotlin.jvm' version '1.2.51'
}
version '1.0-SNAPSHOT'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
testImplementation group: 'junit', name: 'junit', version: '5.3.2'
// JUnit Jupiter API and TestEngine implementation
testImplementation("org.junit.jupiter:junit-jupiter-api:${junitJupiterVersion}")
testRuntime("org.junit.jupiter:junit-jupiter-engine:${junitJupiterVersion}")
testImplementation "org.assertj:assertj-core:3.11.1"
// To avoid compiler warnings about @API annotations in JUnit code
testCompileOnly 'org.apiguardian:apiguardian-api:1.0.0'
implementation 'com.squareup.retrofit2:retrofit:2.5.0'
implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
implementation 'com.squareup.retrofit2:adapter-rxjava:2.5.0'
implementation 'io.reactivex.rxjava2:rxjava:2.2.4'
implementation 'com.google.firebase:firebase-admin:6.6.0'
implementation 'com.google.apis:google-api-services-youtube:v3-rev206-1.25.0'
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
add the current version 27.0
:
dependencies {
api "com.google.guava:guava:27.0-jre"
}
and exclude
both other versions 19.0
and 20.0
, wherever they may be referenced.
./gradlew app:dependencies > dependencies.txt
or check with:
./gradlew app:dependencies | grep guava
for example (the firebase-admin
is certainly a candidate):
// https://mvnrepository.com/artifact/com.google.firebase/firebase-admin
implementation ("com.google.firebase:firebase-admin:6.5.0") {
exclude group: "com.google.guava", module: "guava"
}
there may be further references present.