This is from one of the Java files which is covered by Bazel targets listed in .bazelproject.

This is from the Open All Java Logs in Vscode.
From OUTPUT window, I saw "Bazel build with aspects".

Also saw correct class paths from the OUTPUT.
Result: {
"projectRoot": "file:/myjava",
"classpaths": [
My Java project structure
Root
-WORKSPACE
-java/B/C: Bazel BUILD file
-java/B/D: Bazel BUILD file
For .bazelproject, I have tried
directories:
java
//or java/B/C
derive_targets_from_directories: true
directories:
java
//or java/B/C
derive_targets_from_directories: false
targets:
//java/B/C:all
Also tried updating the .classpath file by adding some
<classpathentry kind="src"...
None of these could solve the issue.