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

Ensure builds run with a specific JVM version #8192

Open
yschimke opened this issue Jan 13, 2024 · 3 comments
Open

Ensure builds run with a specific JVM version #8192

yschimke opened this issue Jan 13, 2024 · 3 comments

Comments

@yschimke
Copy link
Collaborator

          > ```

e: file:///home/runner/work/okhttp/okhttp/okhttp/src/main/kotlin/okhttp3/OkHttpClient.kt:257:33 Type mismatch: inferred type is Long but Int was expected
e: file:///home/runner/work/okhttp/okhttp/okhttp/src/main/kotlin/okhttp3/OkHttpClient.kt:615:27 Type mismatch: inferred type is Int but Long was expected
e: file:///home/runner/work/okhttp/okhttp/okhttp/src/main/kotlin/okhttp3/OkHttpClient.kt:1298:22 Type mismatch: inferred type is Int but Long was expected
e: file:///home/runner/work/okhttp/okhttp/okhttp/src/main/kotlin/okhttp3/OkHttpClient.kt:1326:24 Type mismatch: inferred type is Int but Long was expected

Thanks. I figured out the issue with gradle. I had my JVM set to Java 8. It works with Java 21.

Now these should be gone.

Originally posted by @ArloL in #8189 (comment)

We should fail earlier with a clear message in these cases. Or maybe gradle has a way to cause that?

@swankjesse
Copy link
Collaborator

Or even better, let’s configure Gradle to build on a consistent JVM, regardless of what your environment provides.

@yschimke yschimke changed the title Pre-emptively fail build if requirements not met Ensure builds run with a specific JVM version Apr 1, 2024
@yschimke
Copy link
Collaborator Author

yschimke commented Apr 1, 2024

https://jakewharton.com/gradle-toolchains-are-rarely-a-good-idea/

I guess if we bump this up high, like the latest LTS, it's not terrible?

@JakeWharton
Copy link
Collaborator

LTS releases are for JVM deployments where you are unable to upgrade for (mostly illogical) reasons. Aside from compatibility with build tooling, there's no reason not to use the latest JDK. The best LTS version is the latest version, as it's where security fixes and performance improvements land first.

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

3 participants