Short answer: you can't.
The new better together update allows cross-platform play, but only between the Xbox One S, Xbox One X, Android, iPhone, iPad, Apple TV, Windows 10, Windows Phone, Amazon Fire tablets, Gear VR and eventually the Nintendo Switch edition.
NOTE: When it says Windows 10 it means the Windows 10 Edition, which is different from the Java version for PC/Mac.
As Augustas said, you can't play in a friends world if he is not active. However, if you or a friend purchases a realms subscription, it will be perpetually available so long as you keep paying the fee.
($3.99/mo. for up to 3 simultaneous players, up to $7.99/mo. for up to 11 simultaneous players). Only one person needs to pay this fee - all friends play free. If you want something akin to a Java edition server, this is as close as you can get.
Also, just since you didn't mention it in your question, you do need an Xbox Live Gold membership to be able to access Realms on Xbox One, though it is not needed for other versions.
In the console versions, they (featured servers) are the only servers accessible besides Realms
. You may be out of luck there.