Yes (and vice-versa), as of June 7, 2022. Note that this does not apply to Android, iOS, PlayStation, Switch, or any other platform besides PC, Mac, or Linux.
Starting June 7, all players that have either Java Edition or Bedrock Edition will receive the edition they do not currently own for free, right in the Minecraft Launcher. So if you own Java, you’ll get Bedrock – and vice versa.
Source: JAVA & BEDROCK EDITION FOR PC IS OUT ON JUNE 7, 2022-06-04 Mojang Studios blog post
We’ve been working on some big changes, and we’re excited to announce
that Minecraft: Java Edition and Minecraft for Windows (aka “Bedrock
Edition”) are now being sold as a single product! What does this mean
for you? Well, if you’ve never bought Minecraft before, you can now
get both Java and Bedrock for one low price, also called Minecraft:
Java & Bedrock Edition for PC.
If you have bought Minecraft before, you’re now getting the other
edition for free. Woot! Follow these steps to redeem it:
- Click here to go to the Microsoft Store listing for Minecraft: Java & Bedrock for PC.
- Sign-in to the Microsoft Store with your Microsoft account. Please note: If you still only have a Mojang account and have not yet
migrated to a Microsoft account, you will have to migrate to a
Microsoft account before you can redeem your new game. Don’t fret,
migrating your account is easy and free! (Click
to learn more about account migration or migrate your
account now to
take advantage of this offer.)
- Once you’re signed in, instead of a “Buy” button you should see a button that says “Get.” Click this button – and now you own both
How do I run or play either version of Minecraft?
Once you’ve completed the steps above, including logging into the
Microsoft Store, you can now download the Minecraft Launcher.
- To play Minecraft: Java Edition, download and install the correct launcher for your
operating system. Sign into the Launcher using your Microsoft account,
and you will be able to run Java Edition.
- To play Minecraft: Bedrock Edition, you will need a device running Windows 10 or 11 to download and install the newest version of the
Launcher, within which you can
launch and play Minecraft: Bedrock Edition. Sign into the Launcher
using your Microsoft account, and you will be able to run Minecraft:
I have Minecraft Bedrock Edition on Switch/Mobile/PlayStation/another platform besides PC, Mac or Linux. Do I get Java Edition for free?
Minecraft: Java & Bedrock Edition for PC is only for the PC, Mac, and Linux platforms at the moment. This offer does not apply to consoles or other versions of Minecraft.
Source: Minecraft: Java & Bedrock Edition for PC FAQ