Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation Error in Java #98

Open
newbie-gk opened this issue Feb 12, 2019 · 1 comment
Open

Compilation Error in Java #98

newbie-gk opened this issue Feb 12, 2019 · 1 comment

Comments

@newbie-gk
Copy link

Hi,
I'm getting these warnings\error when trying to use koma in a java project.

Warning:java: unknown enum constant kotlin.annotation.AnnotationRetention.BINARY
reason: class file for kotlin.annotation.AnnotationRetention not found
Warning:java: unknown enum constant kotlin.annotation.AnnotationTarget.CLASS
reason: class file for kotlin.annotation.AnnotationTarget not found
Warning:java: unknown enum constant kotlin.annotation.AnnotationTarget.FUNCTION
Warning:java: unknown enum constant kotlin.annotation.AnnotationTarget.PROPERTY
Warning:java: unknown enum constant kotlin.annotation.AnnotationTarget.CONSTRUCTOR
Warning:java: unknown enum constant kotlin.annotation.AnnotationTarget.PROPERTY_GETTER
Warning:java: unknown enum constant kotlin.annotation.AnnotationTarget.PROPERTY_SETTER
Error:(74, 16) java: cannot access kotlin.jvm.functions.Function0
class file for kotlin.jvm.functions.Function0 not found

I'm new to Kotlin / using kotlin in Java, not sure if I'm doing something wrong. Any guidance is greatly appreciated.

I built the library using the ./gradlew buildJvm and added the jar files to my project library.

As for using it in java:
import koma.Koma; <-- this seems fine, no import errors

double[][] distanceMatrix = function assigning value to distanceMatrix

Matrix m = Koma.create(distanceMatrix); <-- this is where the Compilation Error happened

@drmoose
Copy link
Contributor

drmoose commented Feb 14, 2019

The classes it can't find are parts of the Kotlin standard library. Since you're not using Kotlin, you'll need to adjust your project's dependencies to include the kotlin standard library manually. If you're using gradle, that looks something like this:

repositories {
    mavenCentral()
}

dependencies {
    compile "org.jetbrains.kotlin:kotlin-stdlib:1.3.21"
}

More information here in the Kotlin documentation.

If you're using something other than gradle, here is a link to the jar you're missing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants