Yes, you can play Minecraft apk java edition with friends on different platforms, but it's not as straightforward as playing on the same platform. Minecraft Java Edition is only compatible with other Java Edition players on the same platform, meaning if you're playing on a PC, you can only play with other Java Edition players on a PC.
However, you can use a third-party program called "Minecraft Realms" to play with friends on different platforms. Minecraft Realms is a subscription-based service provided by Mojang that allows you to create a private server to play with friends. You can invite friends to join your Realm regardless of the platform they're playing on.
Alternatively, you can use a third-party mod or plugin like "GeyserMC" or "PaperMC" to create a server that supports cross-platform play. These mods allow players to connect to a server regardless of the platform they're playing on. However, it's important to note that using mods or plugins can be more complicated and may require some technical knowledge to set up.
Overall, while it may require some extra effort, it is possible to play Minecraft Java Edition with friends on different platforms.