This message was deleted.
# community-support
s
This message was deleted.
v
You generate code and then try to compile it without adding the necessary dependencies like
com.linkedin.pegasus:data
. One of the missing classes is
javax.annotation.Generated
which was present in the standard JRE up to but was removed some time ago. And as you run the build with Java 17 and probably do not use the JVM toolchains feature it is missing. For that class, you either need to compile with an older Java by running Gradle with an older Java or better using the JVM toolchains feature, or you can add the
javax.annotation:javax.annotation-api
compileOnly
dependency, where this annotation is still provided in.
s
I have used toolchain feature as given below
Copy code
tasks.withType(Test).configureEach {
  javaLauncher = javaToolchains.launcherFor {
    languageVersion = JavaLanguageVersion.of(17)
  }
}
v
That's not much relevant. That just sets the launcher for executing tests.
s
can you please elaborate how to use jvn toolchain feature
v
https://docs.gradle.org/current/userguide/toolchains.html For example
Copy code
java {
    toolchain {
        languageVersion.set(JavaLanguageVersion.of(8))
    }
}
s
okey i will try on it.
Not getting any change
v
Sure there is change
The ones I said you can get rid of with that, you got rid off. I.e. missing
javax.annotation.Generated
. But you still miss the libs that it complains about in your dependencies.
s
I have tried it but still stuck in the Error, so like can you suggest me if there is any alternative for pegasus that support for java 17 or did I have to downgrade java for particular module? if Yes then How?