Skip to content

Remove Java.Base#1453

Draft
simonrozsival wants to merge 1 commit into
remove-java-runtime-environmentfrom
dev/simonrozsival/remove-java-base-stacked
Draft

Remove Java.Base#1453
simonrozsival wants to merge 1 commit into
remove-java-runtime-environmentfrom
dev/simonrozsival/remove-java-base-stacked

Conversation

@simonrozsival

Copy link
Copy Markdown
Member

Stacked on #1447 (remove-java-runtime-environment).

Summary

  • Remove the standalone Java.Base binding assembly and generated reference API file.
  • Remove Java.Base from the solution and documentation/tooling references.
  • Remove Java.Interop.Sdk's special-case Java.Base reference forwarding.
  • Clean stale Java.Base-specific comments in generator/runtime code.

Rationale

Java.Base only supported the standalone desktop/JRE binding path. With #1447 removing Java.Runtime.Environment and the standalone JVM runtime surface, the in-repo java.base binding is no longer needed by the remaining Java.Interop or dotnet/android-focused workflows.

Validation

  • dotnet build -t:Prepare
  • dotnet build src/Java.Interop/Java.Interop.csproj --no-restore
  • dotnet build tests/Java.Interop-Tests/Java.Interop-Tests.csproj --no-restore
  • dotnet build tests/generator-Tests/generator-Tests.csproj --no-restore
  • dotnet test tests/Java.Interop-Tests/Java.Interop-Tests.csproj --no-build — 669 passed, 0 failed, 4 skipped

dotnet build Java.Interop.sln still hits the same local baseline failures seen on #1447: NativeTiming CMake compiler probe (ld: library 'c++' not found) and Xamarin.Android.Tools.Bytecode-Tests Gradle/Kotlin setup. No Java.Base-related build errors surfaced.

Remove the standalone java.base binding assembly and its reference
assembly output now that the Java.Runtime.Environment-based desktop
Java path is being removed. Also remove Java.Interop.Sdk special
handling for Java.Base references and stale docs/comments.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 9, 2026 15:53

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the in-repo Java.Base binding assembly (and its associated generated/transform inputs) now that the standalone desktop/JRE binding path has been retired, and cleans up remaining solution/tooling/docs references to it.

Changes:

  • Remove the src/Java.Base project (csproj/targets) and Java.Base-specific transform inputs/files.
  • Remove Java.Base from the solution and SDK/tooling integration points.
  • Clean up stale Java.Base-specific comments in generator/runtime and repo documentation.
Show a summary per file
File Description
tools/generator/SourceWriters/GenericExplicitInterfaceImplementationProperty.cs Updates a comment to remove Java.Base mention while preserving existing JavaInterop1 workaround explanation.
src/Java.Interop/Java.Interop/JniPeerMembers.JniInstanceMethods.cs Removes stacktrace comment lines that referenced deleted Java.Base test/project paths.
src/Java.Base/Transforms/methodmap.csv Deleted as part of removing Java.Base binding transforms.
src/Java.Base/Transforms/Metadata.xml Deleted as part of removing Java.Base binding transforms.
src/Java.Base/Transforms/map.csv Deleted as part of removing Java.Base binding transforms.
src/Java.Base/Transforms/enumflags Deleted as part of removing Java.Base binding transforms.
src/Java.Base/Java.Lang/Throwable.cs Deleted Java.Base-specific partial binding code.
src/Java.Base/Java.Lang/Thread.cs Deleted Java.Base-specific partial binding code.
src/Java.Base/Java.Lang/StringBuilder.cs Deleted Java.Base-specific partial binding code.
src/Java.Base/Java.Lang/StringBuffer.cs Deleted Java.Base-specific partial binding code.
src/Java.Base/Java.Lang/String.cs Deleted Java.Base-specific partial binding code.
src/Java.Base/Java.Lang/Object.cs Deleted Java.Base-specific partial binding code.
src/Java.Base/Java.Lang/Long.cs Deleted Java.Base-specific partial binding code.
src/Java.Base/Java.Lang/Integer.cs Deleted Java.Base-specific partial binding code.
src/Java.Base/Java.Lang/ICharSequence.cs Deleted Java.Base-specific partial binding code.
src/Java.Base/Java.Lang/Float.cs Deleted Java.Base-specific partial binding code.
src/Java.Base/Java.Lang/Double.cs Deleted Java.Base-specific partial binding code.
src/Java.Base/Java.Lang/Class.cs Deleted Java.Base-specific partial binding code.
src/Java.Base/Java.IO/Writer.cs Deleted Java.Base-specific partial binding code.
src/Java.Base/Java.IO/PrintStream.cs Deleted Java.Base-specific partial binding code.
src/Java.Base/Java.Base.targets Deleted build logic used to generate/build Java.Base bindings.
src/Java.Base/Java.Base.csproj Deleted Java.Base project definition.
Java.Interop.sln Removes the Java.Base project and associated solution configuration entries.
build-tools/Java.Interop.Sdk/Sdk/Sdk.targets Removes Java.Base-specific reference forwarding logic from the SDK target.
.github/skills/build-and-test/SKILL.md Removes Java.Base-Tests from the list of common test projects.
.github/copilot-instructions.md Removes Java.Base from the documented repository structure.

Copilot's findings

Comments suppressed due to low confidence (1)

build-tools/Java.Interop.Sdk/Sdk/Sdk.targets:156

  • @(_Ref, ' ') is still included in the generator Exec command, but _Ref is no longer defined/populated anywhere in this target after removing the Java.Base special-case. This makes the command line harder to reason about and suggests a missing (or removed) feature for passing -r references.
    <ItemGroup>
      <!-- I can't find a good way to trim the trailing `\`, so append with `.` so we can sanely quote for $(_Libpath) -->
      <_RefAsmDir Include="@(ReferencePathWithRefAssemblies->'%(RootDir)%(Directory).'->Distinct())" />
      <_Lib Include="@(_RefAsmDir->'-L &quot;%(Identity)&quot;')" />
    </ItemGroup>
    <Exec
        Command="$(DotnetToolPath) $(Generator) $(_GenFlags) $(_ApiLevel) $(_Out) @(_Lib, ' ') @(_Ref, ' ') $(_Codegen) $(_Assembly) $(_TypeMap) $(_LangFeatures) $(_Dirs) $(_Api) $(_WithJavadocXml)"
        IgnoreStandardErrorWarningFormat="True"
  • Files reviewed: 26/27 changed files
  • Comments generated: 0

@simonrozsival simonrozsival marked this pull request as draft June 9, 2026 16:01
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