dotnet / android

.NET for Android provides open-source bindings of the Android SDK for use with .NET managed languages such as C#
MIT License
1.93k stars 532 forks source link

[build] use `javac -source 17 -target 17` #9493

Closed jonathanpeppers closed 1 week ago

jonathanpeppers commented 2 weeks ago

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.