My friends and I want to play Speedrunner vs Hunter on a private world. In Bedrock Edition, you can friend another player by using Xbox Live. As friends, you can join each other's worlds whenever they are on that world. So I am wondering, can I do that in Java edition?
No, you can't. Xbox's friend system is integrated into Xbox Live, not Minecraft itself.
You can very easily host a server for you and your friends to play on, though if your PC isn't very strong, it might not be able to keep up with the constant generation of new chunks and the large number of entities onscreen at any one time. Alternatively, you can use VLAN tools such as Hamachi or ZeroTier, and open a singleplayer world to LAN, which then allows people within your VLAN to join games as if they were in your house.