Skip to content

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.

@github-actions github-actions bot locked and limited conversation to collaborators May 18, 2025
@akoeplinger akoeplinger deleted the dev/peppers/net9-java-source-target branch June 2, 2025 14:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants