Skip to content

[release/9.0.1xx] [build] use javac -source 17 -target 17 (#9493) #10037

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

Closed

Conversation

jonathanpeppers
Copy link
Member

@jonathanpeppers jonathanpeppers commented Apr 15, 2025

Backport of: #9493
Fixes: #9925
Context: https://stackoverflow.com/a/76043133

Running javac with a newer -source and -target can run additional optimizations that results in slightly smaller Java bytecode and runtime performance.

We should do this for all Java code we build as part of the product, as it might improve install size & build times for tools like manifestmerger.jar and r8.jar.

After this change, I got the error:

error: option -bootclasspath not allowed with target 17

Which is fixed by using -classpath instead.

Context: https://stackoverflow.com/a/76043133

Running `javac` with a newer `-source` and `-target` can run
additional optimizations that results in *slightly* smaller Java
bytecode and runtime performance.

We should do this for all Java code we build as part of the product,
as it might improve install size & build times for tools like
`manifestmerger.jar` and `r8.jar`.

After this change, I got the error:

    error: option -bootclasspath not allowed with target 17

Which is fixed by using `-classpath` instead.
@jpobst
Copy link
Contributor

jpobst commented Apr 15, 2025

Note that this change adds a lot of warnings to our build:
#9922

We probably need to determine if these are an issue before we ship them in a stable release.

@jonathanpeppers
Copy link
Member Author

Note that this change adds a lot of warnings to our build: #9922

We probably need to determine if these are an issue before we ship them in a stable release.

I'm trying $(JavacSource/TargetVersion)=9 to see if the same warning appears.

@jonathanpeppers
Copy link
Member Author

Closing this in favor of backporting:

I'll likely create a new PR to backport #10050 after it is merged to main.

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

Successfully merging this pull request may close these issues.

2 participants